mirror of https://github.com/trailofbits/algo
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
853 B
YAML
32 lines
853 B
YAML
7 years ago
|
- name: Configure the client
|
||
|
hosts: localhost
|
||
|
tasks:
|
||
|
- name: Add the droplet to an inventory group
|
||
|
add_host:
|
||
|
name: "{{ client_ip }}"
|
||
|
groups: client-host
|
||
|
ansible_ssh_user: "{{ server_user }}"
|
||
|
|
||
|
- name: Configure the client and install required software
|
||
|
hosts: client-host
|
||
|
gather_facts: false
|
||
|
become: true
|
||
|
vars_files:
|
||
|
- config.cfg
|
||
|
|
||
|
pre_tasks:
|
||
|
- name: Get the OS
|
||
|
raw: uname -a
|
||
|
register: distribution
|
||
|
|
||
|
- name: Ubuntu Xenial | Install prerequisites
|
||
|
raw: >
|
||
|
test -x /usr/bin/python2.7 ||
|
||
|
sudo apt-get update -qq && sudo apt-get install -qq -y python2.7 &&
|
||
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
|
||
|
changed_when: false
|
||
|
when: "'ubuntu' in distribution.stdout"
|
||
|
|
||
|
roles:
|
||
|
- { role: client, tags: ['client'] }
|