2019-09-15 00:39:47 -05:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
2019-09-15 01:08:35 -05:00
|
|
|
- name: Install Ansible-required packages via apt
|
2019-09-15 00:39:47 -05:00
|
|
|
apt:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
vars:
|
|
|
|
packages:
|
2019-09-15 01:38:16 -05:00
|
|
|
- python3-pip
|
|
|
|
- python3-boto
|
|
|
|
- python3-boto3
|
|
|
|
- python3-botocore
|
2019-09-15 00:39:47 -05:00
|
|
|
become: true
|
2019-09-15 01:08:35 -05:00
|
|
|
- name: Install Ansible-required packages via pip
|
|
|
|
pip:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: latest
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- ansible
|
|
|
|
become: true
|
2019-09-15 00:39:47 -05:00
|
|
|
- name: Create .aws directory for salt
|
|
|
|
file:
|
|
|
|
path: ~/.aws
|
|
|
|
state: directory
|
|
|
|
become: true
|
|
|
|
become_user: salt
|
|
|
|
- name: Copy AWS credentials
|
|
|
|
copy:
|
|
|
|
src: "{{ role_path }}/files/awscredentials"
|
|
|
|
dest: ~/.aws/credentials
|
|
|
|
mode: 0600
|
|
|
|
become: true
|
|
|
|
become_user: salt
|
2019-09-15 00:49:01 -05:00
|
|
|
- name: Copy Ansible private key
|
|
|
|
copy:
|
|
|
|
src: "{{ role_path }}/files/ansiblekey"
|
|
|
|
dest: ~/.ssh/ansible
|
|
|
|
mode: 0600
|
|
|
|
become: true
|
|
|
|
become_user: salt
|
2019-09-15 00:39:47 -05:00
|
|
|
- name: Create Projects directory for salt
|
|
|
|
file:
|
|
|
|
path: ~/Projects
|
|
|
|
state: directory
|
|
|
|
become: true
|
|
|
|
become_user: salt
|
|
|
|
- name: Clone Ansible repository
|
|
|
|
git:
|
2019-09-15 02:30:46 -05:00
|
|
|
repo: https://gitlab.com/rehashedsalt/ansible
|
2019-09-15 00:39:47 -05:00
|
|
|
dest: ~/Projects/ansible
|
|
|
|
become: true
|
|
|
|
become_user: salt
|