Skip to content
Snippets Groups Projects
Select Git revision
  • d4c33dfe4b46ea6a056edd761a16c9a359fd5bc5
  • master default
2 results

openbsd_bootstrap.yml

Blame
  • openbsd_bootstrap.yml 706 B
    ---
    # Bootstrap an OpenBSD machine to be able to run Ansible on it.
    
    - name: Install Python
      raw: "PKG_PATH={{ openbsd_pkg_mirror }}/OpenBSD/$(uname -r)/packages/$(arch -s)/ /usr/sbin/pkg_add py-pip"
      register: openbsd_pkg_add_python
      changed_when: "'python' in openbsd_pkg_add_python.stdout"
    
    - name: Symlink python
      file:
        path: /usr/bin/python
        src: /usr/local/bin/python2.7
        state: link
        force: yes
    
    - name: Gather facts
      setup:
    
    - name: Configure pkg
      lineinfile:
        dest: /etc/pkg.conf
        line: 'installpath = {{ openbsd_pkg_mirror }}/OpenBSD/{{ ansible_distribution_release }}/packages/{{ ansible_architecture }}/'
        regexp: '^installpath ='
        state: present
        create: yes