-
Notifications
You must be signed in to change notification settings - Fork 2
/
updates.yml
31 lines (27 loc) · 1.12 KB
/
updates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ansible-playbook --extra-vars="host=s999.okserver.org fact_path='/etc/ansible/facts.d'" updates.yml -vvv
---
- hosts: "{{ host }}"
gather_facts: True
connection: ssh
user: okfn
sudo: true
vars_files:
- ~/ansible/vars/global.yml
- ~/ansible/vars/users.yml
tasks:
- name: ensure facts directory
action: file dest={{ fact_path }} state=directory
tags: ensure_facts_directory
- name: ensure_facts_cron
action: copy src=files/cron.hourly/populate_ansible_facts.py dest=/etc/cron.hourly/populate_ansible_facts.py mode=744
tags: ensure_facts_cron
- name: run_facts_script
action: shell /etc/cron.hourly/populate_ansible_facts.py
tags: run_facts_script
- name: install_updates
action: shell /usr/lib/check_mk_agent/local/apt-security-check --install-security-updates
when: ansible_local.apt.package_updates.security_updates_available == 'True'
tags: install_updates
# - name: check_updates_available
# action: debug msg="a {{ ansible_local.apt.package_updates.security_updates_available }} --"
# tags: check_updates_available