Skip to content

Commit f1316ef

Browse files
authored
Merge pull request #434 from AtlasOfLivingAustralia/newserver-playbook
Add newserver ansible playbook to run once on new servers
2 parents 4db1848 + 22d8b8c commit f1316ef

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ansible/newserver.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# Use this playbook once on a new server to install python2 and python3
3+
# must pass target var e.g. ansible-playbook newserver.yml -i /path/to/inventories/your-inventory-file -u ${USER} --private-key=~/.ssh/id_rsa --extra-vars 'target=bla-bla'
4+
- hosts: '{{ target }}'
5+
gather_facts: false
6+
pre_tasks:
7+
- name: Install python2 and python3 for Ansible
8+
raw: bash -c "test -e /usr/bin/python || (apt -qqy update && apt-get install -qqy python3-minimal 'python2.*-minimal')"
9+
register: output
10+
changed_when: output.stdout != ""
11+
- name: Gathering Facts
12+
setup:
13+
become: yes
14+

0 commit comments

Comments
 (0)