-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aacb650
commit 028e9b1
Showing
8 changed files
with
79 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,9 @@ updates_categories: | |
posthooks_rollback: true | ||
# Automatically removes snapshot after update installation | ||
posthooks_autoremove: true | ||
# Enables Mail delivery after playbook run | ||
mail_enabled: true | ||
# Examples for the supported mail delivery settings: https://docs.ansible.com/ansible/latest/collections/community/general/mail_module.html | ||
mail: | ||
host: mail.local | ||
port: 25 | ||
|
@@ -78,8 +80,3 @@ mail: | |
password: {} | ||
from: "[email protected] (Ansible No-Reply)" | ||
to: User <[email protected]> | ||
subject: Patching of {{ inventory_hostname }} succeded | ||
body: | | ||
{{ inventory_hostname }} was successfully patched! | ||
This is the status: | ||
{{ win_update | default(mail_status_error) | to_nice_json }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
[local] | ||
localhost ansible_connection=local | ||
|
||
[sys] | ||
dc01 ansible_host=1.1.1.1 | ||
dc02 ansible_host=2.2.2.2 | ||
[sys:children] | ||
dc | ||
webserver | ||
|
||
[dc] | ||
dc01 ansible_host=10.13.2.1 | ||
|
||
[webserver] | ||
web01 ansible_host=10.13.1.123 ansible_user=svc-ansible | ||
web02 ansible_host=10.13.1.221 ansible_user=other-ansible-user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ansible==5.1.0 | ||
ansible-core==2.12.1 | ||
certifi==2021.10.8 | ||
cffi==1.15.0 | ||
charset-normalizer==2.0.10 | ||
cryptography==36.0.1 | ||
idna==3.3 | ||
Jinja2==3.0.3 | ||
lxml==4.7.1 | ||
MarkupSafe==2.0.1 | ||
ntlm-auth==1.5.0 | ||
packaging==21.3 | ||
pycparser==2.21 | ||
pyOpenSSL==21.0.0 | ||
pyparsing==3.0.6 | ||
pyvmomi==7.0.3 | ||
pywinrm==0.4.2 | ||
PyYAML==6.0 | ||
requests==2.27.1 | ||
requests-ntlm==1.1.0 | ||
resolvelib==0.5.4 | ||
six==1.16.0 | ||
urllib3==1.26.7 | ||
xmltodict==0.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,30 @@ vcenter_username: "[email protected]" | |
vcenter_password: "password" | ||
|
||
posthooks_rollback: true | ||
posthooks_autoremove: true | ||
posthooks_autoremove: false | ||
|
||
|
||
mail_enabled: false | ||
mail_status_error: | ||
msg: No status available | ||
|
||
mail_success_subject: Patching of {{ inventory_hostname }} succeded | ||
mail_success_message: | | ||
{{ inventory_hostname }} was successfully patched! | ||
This is the status: | ||
{{ win_update | default(mail_status_error) | to_nice_json }} | ||
mail_failure_subject: Patching of {{ inventory_hostname }} failed | ||
mail_failure_message: | | ||
{% if posthooks_rollback == true %} | ||
{% set mail_msg = "As a result, the VM was reverted to the snapshot." %} | ||
{% else %} | ||
{% set mail_msg = "The VM was not changed, but it is strongly advised to roll back to the last Snapshot" %} | ||
{% endif %} | ||
{{ inventory_hostname }} failed to install updates. {{ mail_msg }} | ||
This is the status of Windows Update: | ||
{{ win_update | default(mail_status_error) | to_nice_json }} | ||
mail: | ||
host: mail.local | ||
port: 25 | ||
|
@@ -23,8 +41,3 @@ mail: | |
password: {} | ||
from: "[email protected] (Ansible No-Reply)" | ||
to: User <[email protected]> | ||
subject: Patching of {{ inventory_hostname }} succeded | ||
body: | | ||
{{ inventory_hostname }} was successfully patched! | ||
This is the status: | ||
{{ win_update | default("{'msg': 'No status available'}") | to_nice_json }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters