Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment