diff --git a/local.yml b/local.yml index 39e3b77..cdad471 100644 --- a/local.yml +++ b/local.yml @@ -1,6 +1,8 @@ --- - hosts: localhost connection: local + become: true roles: - packages + - ansibleuser \ No newline at end of file diff --git a/files/sudoers_ansible b/roles/ansibleuser/files/sudoers_ansible similarity index 100% rename from files/sudoers_ansible rename to roles/ansibleuser/files/sudoers_ansible diff --git a/roles/ansibleuser/tasks/main.yml b/roles/ansibleuser/tasks/main.yml new file mode 100644 index 0000000..3b47eda --- /dev/null +++ b/roles/ansibleuser/tasks/main.yml @@ -0,0 +1,19 @@ +- name: add ansible user + user: + name: ansible + system: yes + +- name: set up sudo for ansible user + copy: + src: files/sudoer_ansible + dest: /etc/sudoers.d/ansible + owner: root + group: root + mode: 0440 + +- name: add ansible-pull cron job + cron: + name: ansible auto-provision + user: ansible + minute: "*/10" + job: ansible-pull -o -U https://github.com/DeveloperDurp/DesktopAnsible.git \ No newline at end of file