lint fixes
This commit is contained in:
@@ -4,29 +4,29 @@
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: create HTML report
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/network.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy CSS over
|
||||
- name: Copy CSS over
|
||||
ansible.builtin.copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy logos over
|
||||
- name: Copy logos over
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
src: "{{ item }}"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
loop:
|
||||
- "webpage_logo.png"
|
||||
- "redhat-ansible-logo.svg"
|
||||
- "router.png"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
# - name: Display link to Linux patch report
|
||||
# ansible.builtin.debug:
|
||||
|
||||
@@ -8,4 +8,4 @@ vendor:
|
||||
transport:
|
||||
cliconf: "Network_CLI"
|
||||
netconf: "NETCONF"
|
||||
nxapi: "NX-API"
|
||||
nxapi: "NX-API"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
detailedreport: True
|
||||
detailedreport: true
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
- name: create HTML report
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/windows.html"
|
||||
|
||||
- name: copy CSS over
|
||||
- name: Copy CSS over
|
||||
ansible.builtin.copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
|
||||
- name: copy logos over
|
||||
- name: Copy logos over
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
src: "{{ item }}"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
loop:
|
||||
@@ -19,6 +19,6 @@
|
||||
- "redhat-ansible-logo.svg"
|
||||
- "server.png"
|
||||
|
||||
- name: display link to inventory report
|
||||
- name: Display link to inventory report
|
||||
ansible.builtin.debug:
|
||||
msg: "Please go to http://{{ ansible_host }}/windows.html"
|
||||
msg: "Please go to http://{{ ansible_host }}/windows.html"
|
||||
|
||||
@@ -1 +1 @@
|
||||
file_path: /var/www/html
|
||||
file_path: /var/www/html
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
EMAIL_FROM: tower@shadowman.dev
|
||||
email_from: tower@shadowman.dev
|
||||
to_emails: alex@shadowman.dev,tower@shadowman.dev
|
||||
EMAIL_TO: "{{ to_emails.split(',') }}"
|
||||
to_emails_list: "{{ to_emails.split(',') }}"
|
||||
|
||||
@@ -2,21 +2,21 @@
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/windowspatch.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Copy CSS over
|
||||
ansible.builtin.copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Copy logo over
|
||||
ansible.builtin.copy:
|
||||
src: "webpage_logo.png"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Display link to Patch report
|
||||
ansible.builtin.debug:
|
||||
@@ -33,6 +33,6 @@
|
||||
from: "{{ EMAIL_FROM }}"
|
||||
to: "{{ EMAIL_TO }}"
|
||||
subtype: html
|
||||
delegate_to: localhost
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
@@ -1 +1 @@
|
||||
file_path: /var/www/html
|
||||
file_path: /var/www/html
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
---
|
||||
exclude_packages: []
|
||||
allow_reboot: true
|
||||
allow_reboot: true
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
---
|
||||
- name: get packages
|
||||
- name: Get packages
|
||||
ansible.builtin.package_facts:
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: get services
|
||||
- name: Get services
|
||||
ansible.builtin.service_facts:
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: upgrade packages (yum)
|
||||
yum:
|
||||
- name: Upgrade packages (yum)
|
||||
ansible.builtin.yum:
|
||||
name: '*'
|
||||
state: latest
|
||||
state: latest # noqa: package-latest - Intended to update packages to latest
|
||||
exclude: "{{ exclude_packages }}"
|
||||
when: ansible_pkg_mgr == "yum"
|
||||
register: patchingresult_yum
|
||||
|
||||
- name: upgrade packages (dnf)
|
||||
- name: Upgrade packages (dnf)
|
||||
ansible.builtin.dnf:
|
||||
name: '*'
|
||||
state: latest
|
||||
state: latest # noqa: package-latest - Intended to update packages to latest
|
||||
exclude: "{{ exclude_packages }}"
|
||||
when: ansible_pkg_mgr == "dnf"
|
||||
register: patchingresult_dnf
|
||||
@@ -28,10 +28,10 @@
|
||||
register: result
|
||||
changed_when: result.rc == 1
|
||||
failed_when: result.rc > 1
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Reboot Server if Necessary
|
||||
ansible.builtin.reboot:
|
||||
when:
|
||||
- result.rc == 1
|
||||
- allow_reboot == true
|
||||
- result.rc == 1
|
||||
- allow_reboot == true
|
||||
|
||||
@@ -11,4 +11,4 @@ win_update_categories:
|
||||
- Tools
|
||||
- UpdateRollups
|
||||
- Updates
|
||||
allow_reboot: true
|
||||
allow_reboot: true
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
- name: Scan packages
|
||||
demo.patching.win_scan_packages:
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Scan Services
|
||||
demo.patching.win_scan_services:
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Install Windows Updates
|
||||
ansible.windows.win_updates:
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
detailedreport: True
|
||||
detailedreport: true
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
- name: create HTML report
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/linux.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy CSS over
|
||||
- name: Copy CSS over
|
||||
ansible.builtin.copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy logos over
|
||||
- name: Copy logos over
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
src: "{{ item }}"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
loop:
|
||||
- "webpage_logo.png"
|
||||
- "redhat-ansible-logo.svg"
|
||||
- "server.png"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: display link to inventory report
|
||||
- name: Display link to inventory report
|
||||
ansible.builtin.debug:
|
||||
msg: "Please go to http://{{ hostvars[report_server]['ansible_host'] }}/reports/linux.html"
|
||||
|
||||
@@ -1 +1 @@
|
||||
file_path: /var/www/html/reports
|
||||
file_path: /var/www/html/reports
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
EMAIL_FROM: tower@shadowman.dev
|
||||
email_from: tower@shadowman.dev
|
||||
to_emails: alex@shadowman.dev,tower@shadowman.dev
|
||||
EMAIL_TO: "{{ to_emails.split(',') }}"
|
||||
to_emails_list: "{{ to_emails.split(',') }}"
|
||||
|
||||
@@ -2,38 +2,38 @@
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/linuxpatch.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Copy CSS over
|
||||
ansible.builtin.copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Copy logo over
|
||||
ansible.builtin.copy:
|
||||
src: "webpage_logo.png"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Display link to Linux patch report
|
||||
ansible.builtin.debug:
|
||||
msg: "Please go to http://{{ hostvars[report_server]['ansible_host'] }}/reports/linuxpatch.html"
|
||||
|
||||
|
||||
#- name: Send Report via E-mail
|
||||
# community.general.mail:
|
||||
# host: "{{ EMAIL_HOST }}"
|
||||
# username: "{{ EMAIL_USERNAME }}"
|
||||
# password: "{{ EMAIL_PASSWORD }}"
|
||||
# port: "{{ EMAIL_PORT }}"
|
||||
# subject: "Linux Patching Report"
|
||||
# body: "{{ lookup('template', 'report.j2') }}"
|
||||
# from: "{{ EMAIL_FROM }}"
|
||||
# to: "{{ EMAIL_TO }}"
|
||||
# subtype: html
|
||||
# delegate_to: localhost
|
||||
# become: false
|
||||
# check_mode: no
|
||||
# - name: Send Report via E-mail
|
||||
# community.general.mail:
|
||||
# host: "{{ EMAIL_HOST }}"
|
||||
# username: "{{ EMAIL_USERNAME }}"
|
||||
# password: "{{ EMAIL_PASSWORD }}"
|
||||
# port: "{{ EMAIL_PORT }}"
|
||||
# subject: "Linux Patching Report"
|
||||
# body: "{{ lookup('template', 'report.j2') }}"
|
||||
# from: "{{ EMAIL_FROM }}"
|
||||
# to: "{{ EMAIL_TO }}"
|
||||
# subtype: html
|
||||
# delegate_to: localhost
|
||||
# become: false
|
||||
# check_mode: no
|
||||
|
||||
@@ -1 +1 @@
|
||||
file_path: /var/www/html/reports
|
||||
file_path: /var/www/html/reports
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
---
|
||||
- include_vars: "{{ ansible_system }}.yml"
|
||||
- name: Inlcude system variables
|
||||
ansible.builtin.include_vars: "{{ ansible_system }}.yml"
|
||||
|
||||
- yum:
|
||||
- name: Install httpd package
|
||||
ansible.builtin.yum:
|
||||
name: httpd
|
||||
state: latest
|
||||
check_mode: no
|
||||
state: installed
|
||||
check_mode: false
|
||||
|
||||
- file:
|
||||
- name: Create reports directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ doc_root }}/{{ reports_dir }}"
|
||||
state: directory
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- copy:
|
||||
- name: Copy .htaccess
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ doc_root }}/{{ reports_dir }}/.htaccess"
|
||||
content: Options +Indexes
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- service:
|
||||
- name: Install httpd service
|
||||
ansible.builtin.service:
|
||||
name: httpd
|
||||
state: started
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
---
|
||||
- include_vars: "{{ ansible_system }}.yml"
|
||||
- name: Include system vars
|
||||
ansible.builtin.include_vars: "{{ ansible_system }}.yml"
|
||||
|
||||
- name: Install IIS
|
||||
ansible.windows.win_feature:
|
||||
name: Web-Server
|
||||
state: present
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Start IIS service
|
||||
ansible.windows.win_service:
|
||||
name: W3Svc
|
||||
state: started
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Create Directory
|
||||
ansible.windows.win_file:
|
||||
path: "{{ doc_root }}\\{{ reports_dir }}"
|
||||
state: directory
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Enable Directory Browsing
|
||||
ansible.windows.win_powershell:
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
- include_vars: "{{ ansible_system }}.yml"
|
||||
- name: Include system vars
|
||||
ansible.builtin.include_vars: "{{ ansible_system }}.yml"
|
||||
|
||||
- name: get reports
|
||||
- name: Get reports
|
||||
ansible.builtin.find:
|
||||
paths: "{{ doc_root }}/{{ reports_dir }}"
|
||||
patterns: '*.html'
|
||||
register: reports
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: publish landing page
|
||||
- name: Publish landing page
|
||||
ansible.builtin.template:
|
||||
src: linux_report.j2
|
||||
dest: "{{ doc_root }}/index.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy CSS over
|
||||
- name: Copy CSS
|
||||
ansible.builtin.copy:
|
||||
src: "css"
|
||||
dest: "{{ doc_root }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy logos over
|
||||
- name: Copy logos
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
src: "{{ item }}"
|
||||
dest: "{{ doc_root }}"
|
||||
directory_mode: true
|
||||
loop:
|
||||
- "webpage_logo.png"
|
||||
- "redhat-ansible-logo.svg"
|
||||
- "report.png"
|
||||
check_mode: no
|
||||
|
||||
check_mode: false
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
- include_tasks: apache.yml
|
||||
- name: Include Linux tasks
|
||||
ansible.builtin.include_tasks: apache.yml
|
||||
when: ansible_system == 'Linux'
|
||||
|
||||
- include_tasks: iis.yml
|
||||
- name: Include Windows tasks
|
||||
ansible.builtin.include_tasks: iis.yml
|
||||
when: ansible_system == 'Win32NT'
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
- include_vars: "{{ ansible_system }}.yml"
|
||||
- name: Include system variables
|
||||
ansible.builtin.include_vars: "{{ ansible_system }}.yml"
|
||||
|
||||
- name: get reports
|
||||
- name: Get reports
|
||||
ansible.windows.win_find:
|
||||
paths: "{{ doc_root }}/{{ reports_dir }}"
|
||||
patterns: '*.html'
|
||||
register: reports
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: publish landing page
|
||||
ansible.builtin.win_template:
|
||||
- name: Publish landing page
|
||||
ansible.windows.win_template:
|
||||
src: windows_report.j2
|
||||
dest: "{{ doc_root }}/index.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy CSS over
|
||||
ansible.builtin.win_copy:
|
||||
- name: Copy CSS
|
||||
ansible.windows.win_copy:
|
||||
src: "css"
|
||||
dest: "{{ doc_root }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy logos over
|
||||
ansible.builtin.win_copy:
|
||||
src: "{{ item }}"
|
||||
- name: Copy logos
|
||||
ansible.windows.win_copy:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ doc_root }}"
|
||||
directory_mode: true
|
||||
loop:
|
||||
- "webpage_logo.png"
|
||||
- "redhat-ansible-logo.svg"
|
||||
- "report.png"
|
||||
check_mode: no
|
||||
|
||||
check_mode: false
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
detailedreport: True
|
||||
detailedreport: true
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
---
|
||||
- name: create HTML report
|
||||
- name: Create HTML report
|
||||
ansible.windows.win_template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/windows.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy CSS over
|
||||
- name: Copy CSS over
|
||||
ansible.windows.win_copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: copy logos over
|
||||
- name: Copy logos over
|
||||
ansible.windows.win_copy:
|
||||
src: "{{ item }}"
|
||||
src: "{{ item }}"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
loop:
|
||||
- "webpage_logo.png"
|
||||
- "redhat-ansible-logo.svg"
|
||||
- "server.png"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
#- name: display link to inventory report
|
||||
# ansible.builtin.debug:
|
||||
# msg: "Please go to http://{{ host_vars[report_server]['ansible_host'] }}/reports/windows.html"
|
||||
# - name: display link to inventory report
|
||||
# ansible.builtin.debug:
|
||||
# msg: "Please go to http://{{ host_vars[report_server]['ansible_host'] }}/reports/windows.html"
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
file_path: C:\Inetpub\wwwroot\reports
|
||||
---
|
||||
file_path: C:\Inetpub\wwwroot\reports
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
EMAIL_FROM: tower@shadowman.dev
|
||||
---
|
||||
email_from: tower@shadowman.dev
|
||||
to_emails: alex@shadowman.dev,tower@shadowman.dev
|
||||
EMAIL_TO: "{{ to_emails.split(',') }}"
|
||||
to_emails_list: "{{ to_emails.split(',') }}"
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
ansible.windows.win_template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}/windowspatch.html"
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Copy CSS over
|
||||
ansible.windows.win_copy:
|
||||
src: "css"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Copy logo over
|
||||
ansible.windows.win_copy:
|
||||
src: "webpage_logo.png"
|
||||
dest: "{{ file_path }}"
|
||||
directory_mode: true
|
||||
check_mode: no
|
||||
check_mode: false
|
||||
|
||||
- name: Display link to Patch report
|
||||
ansible.builtin.debug:
|
||||
msg: "Please go to http://{{ hostvars[report_server]['ansible_host'] }}/reports/windowspatch.html"
|
||||
msg: "Please go to http://{{ hostvars[report_server]['ansible_host'] }}/reports/windowspatch.html"
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
file_path: C:\Inetpub\wwwroot\reports
|
||||
---
|
||||
file_path: C:\Inetpub\wwwroot\reports
|
||||
|
||||
Reference in New Issue
Block a user