mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-11-02 19:20:15 +00:00
changes for admin proxy credentials
This commit is contained in:
1 parent
f4bbf6cf95
commit
60d0edd4b5
7 files changed
+66
-35
No files matched your search
@@ -39,7 +39,9 @@
|
||||
tag_project_zone: "{{ project_zone }}"
|
||||
state: "{{ state }}"
|
||||
delegate_to: "localhost"
|
||||
notify: "activate changes"
|
||||
notify:
|
||||
- "activate changes"
|
||||
- "schedule downtime"
|
||||
tags:
|
||||
- checkmk_host
|
||||
- checkmk_host_update
|
||||
@@ -57,36 +59,23 @@
|
||||
state: "present"
|
||||
run_once: true
|
||||
delegate_to: "localhost"
|
||||
notify: "activate changes"
|
||||
notify:
|
||||
- "activate changes"
|
||||
- "schedule downtime"
|
||||
when: project_zone == 'protected'
|
||||
tags: checkmk_proxy
|
||||
tags:
|
||||
- checkmk_proxy
|
||||
- checkmk_all
|
||||
|
||||
- name: Flush handlers
|
||||
meta: flush_handlers
|
||||
tags: always
|
||||
|
||||
- name: Pause for 30 seconds to allow changes to activate.
|
||||
ansible.builtin.pause:
|
||||
seconds: 30
|
||||
run_once: true
|
||||
|
||||
- name: Create downtimes for new VMs
|
||||
block:
|
||||
- name: "Schedule downtime on Windows VMs to cover deployment"
|
||||
checkmk.general.downtime:
|
||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||
site: "{{ checkmk_agent_site }}"
|
||||
automation_user: "{{ checkmk_agent_user }}"
|
||||
automation_secret: "{{ checkmk_password }}"
|
||||
host_name: "{{ inventory_hostname }}"
|
||||
state: "{{ state }}" # might need to create hosts them move so teardown works??? or leave folder after teardown or add only teardown task after
|
||||
start_after:
|
||||
minutes: 0
|
||||
end_after:
|
||||
days: 0
|
||||
hours: 3
|
||||
delegate_to: "localhost"
|
||||
tags: checkmk_downtime
|
||||
|
||||
handlers:
|
||||
- name: "Activate Changes"
|
||||
listen: activate changes
|
||||
@@ -98,8 +87,26 @@
|
||||
force_foreign_changes: "false"
|
||||
validate_certs: "true"
|
||||
delegate_to: "localhost"
|
||||
tags: always
|
||||
run_once: true
|
||||
|
||||
- name: "Schedule downtime"
|
||||
listen: schedule downtime
|
||||
checkmk.general.downtime:
|
||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||
site: "{{ checkmk_agent_site }}"
|
||||
automation_user: "{{ checkmk_agent_user }}"
|
||||
automation_secret: "{{ checkmk_password }}"
|
||||
host_name: "{{ inventory_hostname }}"
|
||||
state: "{{ state }}" # might need to create hosts them move so teardown works??? or leave folder after teardown or add only teardown task after
|
||||
start_after:
|
||||
minutes: 0
|
||||
end_after:
|
||||
days: 0
|
||||
hours: 3
|
||||
tags: always
|
||||
delegate_to: "localhost"
|
||||
|
||||
- name: CheckMK Agent
|
||||
hosts: "meta-win_project_{{ win_project }}:&meta-os_windows"
|
||||
gather_facts: false
|
||||
@@ -131,17 +138,6 @@
|
||||
win_shell: |
|
||||
sl 'C:\Program Files (x86)\checkmk\service'
|
||||
.\cmk-agent-ctl register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
||||
#when: project_zone == 'standard' or
|
||||
# inventory_hostname in groups['meta-type_server']
|
||||
|
||||
#- name: register TLS on client (Protected)
|
||||
# vars:
|
||||
# ansible_connection: local
|
||||
# shell: |
|
||||
# sudo cmk-agent-ctl proxy-register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
||||
# delegate_to: localhost
|
||||
# when: project_zone == 'protected' and
|
||||
# inventory_hostname in groups['meta-type_client']
|
||||
tags:
|
||||
- checkmk_host
|
||||
- checkmk_tls
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
win_get_url:
|
||||
url: "{{ wazuh_url }}/{{ wazuh_msi }}"
|
||||
dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}"
|
||||
proxy_url: "http://{{ hostvars[proxy_ip].ansible_host }}:3128"
|
||||
proxy_username: "{{ proxy_user }}"
|
||||
proxy_password: "{{ proxy_user_password }}"
|
||||
when: |
|
||||
inventory_hostname in groups['meta-type_client']|default([]) and
|
||||
project_zone == 'protected'
|
||||
|
||||
Reference in new issue
Block a user