From cc21dd2cc1beb563bf9aeba986c2f67593c3218d Mon Sep 17 00:00:00 2001 From: "ansible-code-bot[bot]" <146274539+ansible-code-bot[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 13:27:05 +0000 Subject: [PATCH] Fix ansible-lint rule violations --- ServiceNowCR_and_approve.yml | 1 + ServiceNowCR_canceled.yml | 3 ++- ServiceNowCR_closed.yml | 3 ++- ServiceNowCR_create.yml | 3 ++- ServiceNowCR_deleted.yml | 3 ++- ServiceNowCR_implement.yml | 3 ++- ServiceNowCatalog.yml | 1 + ServiceNow_cmdb_update.yml | 1 + ServiceNowticket.yml | 3 ++- ServiceNowticket_close.yml | 3 ++- ServiceNowticket_eda.yml | 3 ++- ServiceNowticket_find.yml | 3 ++- ServiceNowticket_inprogress.yml | 3 ++- ServiceNowticket_security.yml | 5 +++-- ServiceNowuser_create.yml | 1 + collections/requirements.yml | 2 +- roles/servicenow_change_request/defaults/main.yml | 2 +- .../tasks/servicenow_create.yml | 4 ++-- roles/servicenow_change_request_wait/tasks/main.yml | 12 +++++++----- roles/servicenow_ticket/defaults/main.yml | 2 +- roles/servicenow_ticket/tasks/servicenow_close.yml | 2 +- .../tasks/servicenow_create_eda.yml | 2 +- 22 files changed, 41 insertions(+), 24 deletions(-) diff --git a/ServiceNowCR_and_approve.yml b/ServiceNowCR_and_approve.yml index e155b8b..3b94b92 100644 --- a/ServiceNowCR_and_approve.yml +++ b/ServiceNowCR_and_approve.yml @@ -1,3 +1,4 @@ +--- - name: Create and wait for approval of a change request hosts: localhost gather_facts: false diff --git a/ServiceNowCR_canceled.yml b/ServiceNowCR_canceled.yml index 47ccea1..2155e77 100644 --- a/ServiceNowCR_canceled.yml +++ b/ServiceNowCR_canceled.yml @@ -1,10 +1,11 @@ +--- - name: Cancel a change request hosts: localhost gather_facts: false connection: local vars: - servicenow_cr: "canceled" + servicenow_cr: canceled roles: - servicenow_change_request diff --git a/ServiceNowCR_closed.yml b/ServiceNowCR_closed.yml index 74fd375..743506d 100644 --- a/ServiceNowCR_closed.yml +++ b/ServiceNowCR_closed.yml @@ -1,10 +1,11 @@ +--- - name: Close a change request hosts: localhost gather_facts: false connection: local vars: - servicenow_cr: "close" + servicenow_cr: close roles: - servicenow_change_request diff --git a/ServiceNowCR_create.yml b/ServiceNowCR_create.yml index d56497a..5db6a50 100644 --- a/ServiceNowCR_create.yml +++ b/ServiceNowCR_create.yml @@ -1,10 +1,11 @@ +--- - name: Create a change request hosts: all gather_facts: false connection: local vars: - servicenow_cr: "create" + servicenow_cr: create roles: - servicenow_change_request diff --git a/ServiceNowCR_deleted.yml b/ServiceNowCR_deleted.yml index c933c60..3e5c182 100644 --- a/ServiceNowCR_deleted.yml +++ b/ServiceNowCR_deleted.yml @@ -1,10 +1,11 @@ +--- - name: Delete a change request hosts: localhost gather_facts: false connection: local vars: - servicenow_cr: "absent" + servicenow_cr: absent roles: - servicenow_change_request diff --git a/ServiceNowCR_implement.yml b/ServiceNowCR_implement.yml index 409e11a..2485808 100644 --- a/ServiceNowCR_implement.yml +++ b/ServiceNowCR_implement.yml @@ -1,10 +1,11 @@ +--- - name: Implement a change request hosts: localhost gather_facts: false connection: local vars: - servicenow_cr: "implement" + servicenow_cr: implement roles: - servicenow_change_request diff --git a/ServiceNowCatalog.yml b/ServiceNowCatalog.yml index 623cade..635e60a 100644 --- a/ServiceNowCatalog.yml +++ b/ServiceNowCatalog.yml @@ -1,3 +1,4 @@ +--- - name: Update a catalog item in ServiceNow hosts: localhost gather_facts: false diff --git a/ServiceNow_cmdb_update.yml b/ServiceNow_cmdb_update.yml index 66f39e7..d7b2eb6 100644 --- a/ServiceNow_cmdb_update.yml +++ b/ServiceNow_cmdb_update.yml @@ -1,3 +1,4 @@ +--- - name: Update CMDB table hosts: "{{ vm_name | default('all') }}" gather_facts: false diff --git a/ServiceNowticket.yml b/ServiceNowticket.yml index 07e32a7..1f77c7c 100644 --- a/ServiceNowticket.yml +++ b/ServiceNowticket.yml @@ -1,10 +1,11 @@ +--- - name: Create an incident in ServiceNow using facts from a host hosts: "{{ vm_name | default('all')}}" gather_facts: false connection: local vars: - servicenow_ticket: "create" + servicenow_ticket: create roles: - servicenow_ticket diff --git a/ServiceNowticket_close.yml b/ServiceNowticket_close.yml index 4c3c4eb..e5db438 100644 --- a/ServiceNowticket_close.yml +++ b/ServiceNowticket_close.yml @@ -1,10 +1,11 @@ +--- - name: Close an incident in ServiceNow hosts: all gather_facts: false connection: local vars: - servicenow_ticket: "close" + servicenow_ticket: close roles: - servicenow_ticket diff --git a/ServiceNowticket_eda.yml b/ServiceNowticket_eda.yml index c055e3e..378d679 100644 --- a/ServiceNowticket_eda.yml +++ b/ServiceNowticket_eda.yml @@ -1,10 +1,11 @@ +--- - name: Create an incident in ServiceNow from EDA hosts: "{{ vm_name | default('all')}}" gather_facts: false connection: local vars: - servicenow_ticket: "createeda" + servicenow_ticket: createeda roles: - servicenow_ticket diff --git a/ServiceNowticket_find.yml b/ServiceNowticket_find.yml index fb527ad..c3fc57a 100644 --- a/ServiceNowticket_find.yml +++ b/ServiceNowticket_find.yml @@ -1,9 +1,10 @@ +--- - name: Find an incident in ServiceNow hosts: localhost gather_facts: false vars: - servicenow_ticket: "find" + servicenow_ticket: find roles: - servicenow_ticket diff --git a/ServiceNowticket_inprogress.yml b/ServiceNowticket_inprogress.yml index 3fddfc4..3ad9825 100644 --- a/ServiceNowticket_inprogress.yml +++ b/ServiceNowticket_inprogress.yml @@ -1,10 +1,11 @@ +--- - name: Update an incident in ServiceNow hosts: all gather_facts: false connection: local vars: - servicenow_ticket: "update" + servicenow_ticket: update roles: - servicenow_ticket diff --git a/ServiceNowticket_security.yml b/ServiceNowticket_security.yml index 26374d7..4c3b16d 100644 --- a/ServiceNowticket_security.yml +++ b/ServiceNowticket_security.yml @@ -1,13 +1,14 @@ +--- - name: Create an incident in ServiceNow for IP Blocking hosts: localhost gather_facts: false connection: local vars: - incident_description: "AAP IP Block" + incident_description: AAP IP Block sn_urgency: high sn_impact: high - servicenow_ticket: "create" + servicenow_ticket: create roles: - servicenow_ticket diff --git a/ServiceNowuser_create.yml b/ServiceNowuser_create.yml index 002b826..076f7c8 100644 --- a/ServiceNowuser_create.yml +++ b/ServiceNowuser_create.yml @@ -1,3 +1,4 @@ +--- - name: Create a servicenow admin user hosts: localhost gather_facts: false diff --git a/collections/requirements.yml b/collections/requirements.yml index ed347d1..fc3868b 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,5 +1,5 @@ +--- collections: - - name: community.general - name: servicenow.itsm diff --git a/roles/servicenow_change_request/defaults/main.yml b/roles/servicenow_change_request/defaults/main.yml index 663a588..f5be674 100644 --- a/roles/servicenow_change_request/defaults/main.yml +++ b/roles/servicenow_change_request/defaults/main.yml @@ -1,3 +1,3 @@ --- -servicenow_cr: "create" +servicenow_cr: create to_email: "{{ to_emails.split(',') }}" diff --git a/roles/servicenow_change_request/tasks/servicenow_create.yml b/roles/servicenow_change_request/tasks/servicenow_create.yml index 3e323fd..6b118f5 100644 --- a/roles/servicenow_change_request/tasks/servicenow_create.yml +++ b/roles/servicenow_change_request/tasks/servicenow_create.yml @@ -3,8 +3,8 @@ servicenow.itsm.change_request: state: new type: standard - template: "Reboot Windows Server - 1" - short_description: "Reboot Windows Server" + template: Reboot Windows Server - 1 + short_description: Reboot Windows Server requested_by: admin other: cmdb_ci: "{{ ip_addr }}" diff --git a/roles/servicenow_change_request_wait/tasks/main.yml b/roles/servicenow_change_request_wait/tasks/main.yml index b346adc..d51d82b 100644 --- a/roles/servicenow_change_request_wait/tasks/main.yml +++ b/roles/servicenow_change_request_wait/tasks/main.yml @@ -6,11 +6,12 @@ servicenow.itsm.change_request: type: normal short_description: "{{ cr_description }}" - description: "{{ owner | default('Shadowman') }} requests {{ operating_system | default('') }} server in {{ shadowman_provision_hypervisor | default('') }} with name {{ vm_name | default('') }} and environment {{ env | default('test') }}" + description: "{{ owner | default('Shadowman') }} requests {{ operating_system | default('') }} server in {{ shadowman_provision_hypervisor | default('') }} + with name {{ vm_name | default('') }} and environment {{ env | default('test') }}" priority: high risk: moderate impact: low - assignment_group: "CAB Approval" + assignment_group: CAB Approval state: assess register: request until: request.changed is defined @@ -31,8 +32,9 @@ username: "{{ EMAIL_USERNAME }}" password: "{{ EMAIL_PASSWORD }}" port: "{{ EMAIL_PORT }}" - subject: "Approval request for ServiceNow Change Request {{ request.record.number }}" - body: "You have a new CR Approval request. Please click on this URL to approve: {{ lookup('env', 'SN_HOST') }}nav_to.do?uri=change_request.do?sysparm_query=number={{ request.record.number }}" + subject: Approval request for ServiceNow Change Request {{ request.record.number }} + body: "You have a new CR Approval request. Please click on this URL to approve: {{ lookup('env', 'SN_HOST') }}nav_to.do?uri=change_request.do?sysparm_query=number={{ + request.record.number }}" from: tower@shadowman.dev to: "{{ to_email }}" delegate_to: localhost @@ -50,5 +52,5 @@ servicenow.itsm.change_request: state: implement number: "{{ request.record.number }}" - assignment_group: "CAB Approval" + assignment_group: CAB Approval delegate_to: localhost diff --git a/roles/servicenow_ticket/defaults/main.yml b/roles/servicenow_ticket/defaults/main.yml index aeae9b6..d070a8c 100644 --- a/roles/servicenow_ticket/defaults/main.yml +++ b/roles/servicenow_ticket/defaults/main.yml @@ -1,2 +1,2 @@ --- -servicenow_ticket: "create" +servicenow_ticket: create diff --git a/roles/servicenow_ticket/tasks/servicenow_close.yml b/roles/servicenow_ticket/tasks/servicenow_close.yml index 6b3407e..d4ccada 100644 --- a/roles/servicenow_ticket/tasks/servicenow_close.yml +++ b/roles/servicenow_ticket/tasks/servicenow_close.yml @@ -3,6 +3,6 @@ servicenow.itsm.incident: state: closed number: "{{ ticket_number }}" - close_code: "Solved (Permanently)" + close_code: Solved (Permanently) close_notes: "{{ comment }}" delegate_to: localhost diff --git a/roles/servicenow_ticket/tasks/servicenow_create_eda.yml b/roles/servicenow_ticket/tasks/servicenow_create_eda.yml index b117d54..c1a722f 100644 --- a/roles/servicenow_ticket/tasks/servicenow_create_eda.yml +++ b/roles/servicenow_ticket/tasks/servicenow_create_eda.yml @@ -21,4 +21,4 @@ - name: Pass incident number ansible.builtin.set_stats: data: - ticket_number: "{{ new_incident.record.number }}" \ No newline at end of file + ticket_number: "{{ new_incident.record.number }}"