Skip to content

Commit

Permalink
Lock root user and check for python
Browse files Browse the repository at this point in the history
  • Loading branch information
m-wynn committed Mar 24, 2017
1 parent 268cb36 commit 936d552
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
sg_pkg_path: https://mirror.esc7.net/pub/OpenBSD/
16 changes: 13 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
- name: Check if python is installed
become: no
raw: sh -c "stat /usr/bin/python > /dev/null"
changed_when: python_present.rc != 0
register: python_present
ignore_errors: yes

- name: Install python2
become: yes
become_method: su
raw: sh -c "test -e /usr/local/bin/python2.7 || pkg_add -z python-2.7"
register: command_result
changed_when: command_result.stdout != '\r\n'
raw: sh -c "PKG_PATH={{ sg_pkg_path }} pkg_add -z python-2.7 && ln -sf /usr/local/bin/python2.7 /usr/bin/python"
register: install_python
changed_when: install_python.stdout != '\r\n'
when: python_present.changed

- name: Enable Doas
become: yes
Expand All @@ -15,3 +23,5 @@
owner: root
group: wheel
mode: 0644
when: python_present.changed
register: doas_enabled

0 comments on commit 936d552

Please sign in to comment.