ansible/roles/ansible-pull/tasks/main.yml

28 lines
789 B
YAML

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Set up ansible-pull
block:
- name: Copy Ansible password file
copy:
src: ansiblevaultpass
dest: ~/ansiblevaultpass
mode: "0600"
become: yes
become_user: ansible
- name: Template out services
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
loop:
- { src: "ansible-pull.service", dest: "/etc/systemd/system/ansible-pull.service", mode: "0644" }
- { src: "ansible-pull.timer", dest: "/etc/systemd/system/ansible-pull.timer", mode: "0644" }
- name: Enable timer
systemd:
daemon_reload: yes
name: ansible-pull.timer
enabled: yes
state: started
become: yes