Compare commits
No commits in common. "0f40ca47c5101a5548c50daaa601699fd4bb572b" and "fc76d0b8021a2281cde4fbb3502dd5f4ed8f1c7f" have entirely different histories.
0f40ca47c5
...
fc76d0b802
9 changed files with 8 additions and 51 deletions
|
@ -1,7 +1,7 @@
|
||||||
role-ansible-update
|
role-ansible-update
|
||||||
=========
|
=========
|
||||||
|
|
||||||
This role sets up a systemd service/timer and bash script to run ansible daily - staggers hosts hourly based on ansibleid
|
A brief description of the role goes here.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
@ -23,8 +23,8 @@ Example Playbook Template
|
||||||
|
|
||||||
Playbook creation should be handled by playbook-builder. To include role in a playbook, add one of these lines (changing version/branch as needed) to the template with other core entries:
|
Playbook creation should be handled by playbook-builder. To include role in a playbook, add one of these lines (changing version/branch as needed) to the template with other core entries:
|
||||||
|
|
||||||
role:ansible-update:v1.0:core,ansible
|
role:mount:v1.0:core,mount
|
||||||
role:ansible-update:testing:core,ansible
|
role:mount:testing:core,mount
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# defaults file for ansible-update
|
# defaults file for ${REPO_NAME}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Runs ansible playbook
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
RemainAfterExit=no
|
|
||||||
ExecStart=/scripts/run_ansible.sh
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -1,3 +1,3 @@
|
||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# handlers file for ansible-update
|
# handlers file for ${REPO_NAME}
|
||||||
|
|
|
@ -1,27 +1,3 @@
|
||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# tasks file for ansible-update
|
# tasks file for ${REPO_NAME}
|
||||||
- name: deploy ansible update script
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: templates/ansible-update.sh
|
|
||||||
dest: /scripts/ansible-update.sh
|
|
||||||
mode: '0754'
|
|
||||||
|
|
||||||
- name: deploy ansible update service
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: files/ansible-update.service
|
|
||||||
dest: /usr/lib/systemd/system/ansible-update.service
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: deploy ansible update timer
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: files/ansible-update.timer
|
|
||||||
dest: /usr/lib/systemd/system/cansible-update.timer
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: ensure ansible update script is running
|
|
||||||
service:
|
|
||||||
name: ansible-update.timer
|
|
||||||
state: started
|
|
||||||
daemon_reload: true
|
|
||||||
enabled: yes
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Runs run ansible playbook once per day (hour is determined based on ansible id)
|
|
||||||
|
|
||||||
[Timer]
|
|
||||||
OnCalendar=*-*-* {{ansible_machine_id | int(base=16) % 24}}:00:00
|
|
||||||
Unit=certbot-renewal.service
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -3,4 +3,4 @@
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
remote_user: root
|
remote_user: root
|
||||||
roles:
|
roles:
|
||||||
- ansible-update
|
- ${REPO_NAME}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# vars file for ansible-update
|
# vars file for ${REPO_NAME}
|
||||||
|
|
Loading…
Add table
Reference in a new issue