Commit a76d25f2 authored by nimrod's avatar nimrod
Browse files

- Detect failure when installing Python.

- Use variables for OS version and architecture so there's no need to change or
  re-run Ansible after an upgrade.
parent 432ab770
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
- name: Install Python
  raw: "PKG_PATH={{ openbsd_pkg_mirror }}/OpenBSD/$(uname -r)/packages/$(arch -s)/ /usr/sbin/pkg_add -I py-pip"
  register: openbsd_pkg_add_python
  failed_when: "'error' in openbsd_pkg_add_python.stdout|lower"
  changed_when: "'py-pip' in openbsd_pkg_add_python.stdout"

- name: Symlink python
@@ -18,7 +19,7 @@
- name: Configure pkg
  lineinfile:
    dest: /etc/pkg.conf
    line: 'installpath = {{ openbsd_pkg_mirror }}/OpenBSD/{{ ansible_distribution_release }}/packages/{{ ansible_architecture }}/'
    line: 'installpath = {{ openbsd_pkg_mirror }}/OpenBSD/%v/packages/%a/'
    regexp: '^installpath ='
    state: present
    create: yes