added cron and user taskbooks

This commit is contained in:
Jay LaCroix
2020-09-01 16:23:18 -04:00
parent 38479255ad
commit 0ec7ad238b
4 changed files with 21 additions and 0 deletions

View File

@@ -9,4 +9,6 @@
changed_when: False
tasks:
- include: tasks/users.yml
- include: tasks/cron.yml
- include: tasks/packages.yml

6
tasks/cron.yml Normal file
View File

@@ -0,0 +1,6 @@
- name: install cron job (ansible-pull)
cron:
user: ansible
name: "ansible provision"
minute: "*/10"
job: "/usr/bin/ansible-pull -o -U https://github.com/jlacroix82/ansible_pull_tutorial.git > /dev/null"

View File

@@ -0,0 +1 @@
ansible ALL=(ALL) NOPASSWD: ALL

12
tasks/users.yml Normal file
View File

@@ -0,0 +1,12 @@
- name: create ansible user
user:
name: ansible
system: yes
- name: copy sudoers_ansible
copy:
src: files/sudoers_ansible
dest: /etc/sudoers.d/ansible
owner: root
group: root
mode: 0440