2020-02-11 14:42:44 -06:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: Set up Ansible
|
|
|
|
block:
|
|
|
|
- name: Install Ansible-required packages via apt
|
|
|
|
apt:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- python3-pip
|
|
|
|
- python3-boto
|
|
|
|
- python3-boto3
|
|
|
|
- python3-botocore
|
|
|
|
- python3-setuptools
|
|
|
|
become: true
|
|
|
|
- name: Install Ansible-required packages via pip
|
|
|
|
pip:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: latest
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- ansible
|
2020-03-23 02:31:54 -05:00
|
|
|
- name: Assure root .ssh directory
|
|
|
|
file:
|
|
|
|
path: ~/.ssh
|
|
|
|
state: directory
|
|
|
|
mode: "0600"
|
2020-02-11 14:42:44 -06:00
|
|
|
- name: Copy Ansible private key
|
|
|
|
copy:
|
|
|
|
src: ansiblekey
|
|
|
|
dest: ~/.ssh/ansible
|
|
|
|
mode: "0600"
|
2020-03-23 02:31:54 -05:00
|
|
|
become: true
|