Repurpose old ansiblehost role
It's now an automatic pullinator
This commit is contained in:
parent
9cf24c1acc
commit
129cc13848
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/ansible-playbook
|
||||
# vim:ft=ansible:
|
||||
---
|
||||
- name: Set up system for Ansible
|
||||
- name: Install Ansible-required packages via apt
|
||||
apt:
|
||||
name: "{{ packages }}"
|
||||
@ -10,7 +11,6 @@
|
||||
- python3-boto
|
||||
- python3-boto3
|
||||
- python3-botocore
|
||||
become: true
|
||||
- name: Install Ansible-required packages via pip
|
||||
pip:
|
||||
name: "{{ packages }}"
|
||||
@ -18,37 +18,28 @@
|
||||
vars:
|
||||
packages:
|
||||
- ansible
|
||||
become: true
|
||||
- name: Create .aws directory for salt
|
||||
- name: Create .aws directory for root
|
||||
file:
|
||||
path: ~/.aws
|
||||
state: directory
|
||||
become: true
|
||||
become_user: salt
|
||||
- name: Copy AWS credentials
|
||||
copy:
|
||||
src: "{{ role_path }}/files/awscredentials"
|
||||
src: awscredentials
|
||||
dest: ~/.aws/credentials
|
||||
mode: 0600
|
||||
become: true
|
||||
become_user: salt
|
||||
- name: Copy Ansible private key
|
||||
copy:
|
||||
src: "{{ role_path }}/files/ansiblekey"
|
||||
src: ansiblekey
|
||||
dest: ~/.ssh/ansible
|
||||
mode: 0600
|
||||
become: true
|
||||
become_user: salt
|
||||
- name: Create Projects directory for salt
|
||||
file:
|
||||
path: ~/Projects
|
||||
state: directory
|
||||
become: true
|
||||
become_user: salt
|
||||
- name: Clone Ansible repository
|
||||
- name: Create system copy of Ansible repo
|
||||
git:
|
||||
force: true
|
||||
repo: https://gitlab.com/rehashedsalt/ansible
|
||||
dest: ~/Projects/ansible
|
||||
dest: /opt/ansible-repo
|
||||
- name: Set up pull and run cronjob
|
||||
cron:
|
||||
hour: 0
|
||||
name: ansible-pull
|
||||
job: "cd /opt/ansible-repo && ansible-playbook ec2.yml"
|
||||
become: true
|
||||
become_user: salt
|
||||
|
Loading…
Reference in New Issue
Block a user