diff --git a/roles/ansible-pull/handlers/main.yml b/roles/ansible-pull/handlers/main.yml new file mode 100644 index 0000000..7a95227 --- /dev/null +++ b/roles/ansible-pull/handlers/main.yml @@ -0,0 +1,10 @@ +#!/usr/bin/ansible-playbook +# vim:ft=ansible: +--- +- name: restart ansiblepull timer + systemd: + daemon_reload: yes + name: ansible-pull.timer + enabled: yes + state: restarted + become: yes diff --git a/roles/ansible-pull/tasks/main.yml b/roles/ansible-pull/tasks/main.yml index 31cd8f4..4affc52 100644 --- a/roles/ansible-pull/tasks/main.yml +++ b/roles/ansible-pull/tasks/main.yml @@ -18,6 +18,7 @@ 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" } + notify: restart ansiblepull timer - name: Enable timer systemd: daemon_reload: yes diff --git a/roles/ansible-pull/templates/ansible-pull.service b/roles/ansible-pull/templates/ansible-pull.service index 719dcdd..d93edc5 100644 --- a/roles/ansible-pull/templates/ansible-pull.service +++ b/roles/ansible-pull/templates/ansible-pull.service @@ -5,8 +5,7 @@ Description=Ansible pull service [Service] User=ansible Group=ansible -# Forking and not oneshot here because we don't want it stuck in the Activating state forever -Type=forking +Type=oneshot Environment=ANSIBLE_CONFIG=~/ansible-pull-repo/ansible-pull.cfg ExecStart=ansible-pull --tags pull --accept-host-key -U "https://git.9iron.club/salt/ansible" -d "~/ansible-pull-repo" --vault-password-file "~/ansiblevaultpass" site.yml diff --git a/roles/gitea/handlers/main.yml b/roles/gitea/handlers/main.yml index ef22b29..1cfa61a 100644 --- a/roles/gitea/handlers/main.yml +++ b/roles/gitea/handlers/main.yml @@ -6,5 +6,6 @@ daemon_reload: yes name: gitea.service state: restarted + become: yes - name: gitea add default user include_tasks: tasks/add_default_user.yml