Skip to content

Commit

Permalink
Fix ansible-lint rule violations
Browse files Browse the repository at this point in the history
  • Loading branch information
ansible-code-bot[bot] committed Dec 26, 2023
1 parent 246f992 commit 72b487e
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 41 deletions.
1 change: 1 addition & 0 deletions Gitea Deploy New Release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Deploy new Gitea release
hosts: "{{ vm_name | default('all') }}"
gather_facts: false
Expand Down
1 change: 1 addition & 0 deletions Gitea New Release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Create new Gitea release
hosts: localhost
gather_facts: false
Expand Down
12 changes: 6 additions & 6 deletions Web Install and Verification collections.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- name: Install web server, insert an index page, verify service is started and that the index page appears
hosts: "{{ vm_name | default('all') }}"
gather_facts: false

tasks:

- name: RHEL Apache config
ansible.builtin.include_role:
name: webservers_collection
Expand All @@ -25,7 +25,7 @@
validate_certs: false
return_content: true
register: this
failed_when: "inventory_hostname not in this.content"
failed_when: inventory_hostname not in this.content
when: os is match("rhel.*") or os == "Red Hat BYOL Linux"
tags:
- updaterhel
Expand All @@ -36,14 +36,14 @@
validate_certs: false
return_content: true
register: this
failed_when: "inventory_hostname not in this.content"
failed_when: inventory_hostname not in this.content
when: os is match("windows.*") or os is match("2016.*") or os == "Windows"
tags:
- updatewin

- name: Print web address
ansible.builtin.debug:
msg: "Web address is https://{{ ansible_host }}"
msg: Web address is https://{{ ansible_host }}

- name: Set stats for the e-mail body and ServiceNow
ansible.builtin.set_stats:
Expand All @@ -52,8 +52,8 @@
work_notes: "[code]<a href='https://{{ ansible_host }}'>{{ fqdn }}</a>[/code] "
expose_to_cloud_redhat_com_results: "{{ fqdn }}: https://{{ ansible_host }}"

- name: Set stats for the e-mail subject # noqa run-once[task]
- name: Set stats for the e-mail subject # noqa run-once[task]
ansible.builtin.set_stats:
data:
email_subject: "Ansible VM Web Link"
email_subject: Ansible VM Web Link
run_once: true
1 change: 1 addition & 0 deletions Web Verification collections.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Verify index page works
hosts: "{{ vm_name | default('all') }}"
gather_facts: false
Expand Down
2 changes: 1 addition & 1 deletion collections/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
collections:

- name: ansible.windows

- name: community.windows
Expand Down
4 changes: 2 additions & 2 deletions roles/deploy_new_release/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Deploy a new application release
ansible.builtin.unarchive:
src: "https://cicd.shadowman.dev:3000/api/v1/repos/{{ gitea_user }}/{{ repo }}/archive/{{ release_tag }}.tar.gz"
src: https://cicd.shadowman.dev:3000/api/v1/repos/{{ gitea_user }}/{{ repo }}/archive/{{ release_tag }}.tar.gz
remote_src: true
owner: root
group: root
mode: '0755'
mode: "0755"
dest: /var/www
validate_certs: false
11 changes: 3 additions & 8 deletions roles/new_release/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Gather current app releases
ansible.builtin.uri:
url: "https://cicd.shadowman.dev:3000/api/v1/repos/{{ gitea_user }}/{{ repo }}/releases"
url: https://cicd.shadowman.dev:3000/api/v1/repos/{{ gitea_user }}/{{ repo }}/releases
method: GET
user: "{{ gitea_user }}"
password: "{{ gitea_password }}"
Expand All @@ -17,18 +17,13 @@

- name: Create a Gitea Release using basic authentication
ansible.builtin.uri:
url: "https://cicd.shadowman.dev:3000/api/v1/repos/{{ gitea_user }}/{{ repo }}/releases"
url: https://cicd.shadowman.dev:3000/api/v1/repos/{{ gitea_user }}/{{ repo }}/releases
method: POST
user: "{{ gitea_user }}"
password: "{{ gitea_password }}"
body_format: json
force_basic_auth: true
body:
'{"target_commitish": "main",
"name": "Ansible Web App {{ tag }}",
"draft": false,
"prerelease": false,
"tag_name": "{{ tag }}"}'
body: '{"target_commitish": "main", "name": "Ansible Web App {{ tag }}", "draft": false, "prerelease": false, "tag_name": "{{ tag }}"}'
status_code: 201
validate_certs: false
register: __result
Expand Down
2 changes: 1 addition & 1 deletion roles/verification_collection/tasks/rhel_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
validate_certs: false
return_content: true
register: this
failed_when: "inventory_hostname not in this.content"
failed_when: inventory_hostname not in this.content
when: os is match("rhel.*") or os == "Red Hat BYOL Linux"
5 changes: 2 additions & 3 deletions roles/webservers_collection/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---

- name: Setup webserver RHEL
ansible.builtin.include_tasks: rhel_apache_collections.yml
when: os is match("rhel.*") or os == "Red Hat BYOL Linux"
tags:
- updaterhel
- updaterhel

- name: Setup webserver Windows
ansible.builtin.include_tasks: windows_iis_collections.yml
when: os is match("windows.*") or os is match("2016.*") or os == "Windows"
tags:
- updatewin
- updatewin
8 changes: 4 additions & 4 deletions roles/webservers_collection/tasks/rhel_apache_collections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
dest: /var/www/html/
owner: root
group: root
mode: '0644'
mode: "0644"
tags:
- updaterhel

Expand All @@ -42,22 +42,22 @@
dest: /etc/pki/tls/certs/localhost.crt
owner: root
group: root
mode: '0644'
mode: "0644"

- name: Copy Key
ansible.builtin.copy:
src: /certs/shadowman_private.key
dest: /etc/pki/tls/private/localhost.key
owner: root
group: root
mode: '0644'
mode: "0644"

- name: Insert Index Page for webpage
ansible.builtin.template:
src: templates/indexcomplex.html.j2
dest: /var/www/html/index.html
owner: root
group: root
mode: '0644'
mode: "0644"
tags:
- updaterhel
32 changes: 16 additions & 16 deletions roles/webservers_collection/tasks/windows_iis_collections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,29 @@
block:
- name: Remove Default Site
community.windows.win_iis_website:
name: 'Default Web Site'
name: Default Web Site
state: absent
rescue:
- name: Remove Default Site again due to WINRM
community.windows.win_iis_website:
name: 'Default Web Site'
name: Default Web Site
state: absent

- name: Configure site
block:
- name: Configure site
community.windows.win_iis_website:
name: 'Ansible Tower'
physical_path: 'C:\inetpub\wwwroot'
name: Ansible Tower
physical_path: C:\inetpub\wwwroot
state: started
port: 80
ssl: true
notify: IIS_running
rescue:
- name: Configure site twice due to WinRM
community.windows.win_iis_website:
name: 'Ansible Tower'
physical_path: 'C:\inetpub\wwwroot'
name: Ansible Tower
physical_path: C:\inetpub\wwwroot
state: started
port: 80
ssl: true
Expand Down Expand Up @@ -115,18 +115,18 @@
block:
- name: Configure site bindings
community.windows.win_iis_webbinding:
name: 'Ansible Tower'
port: '443'
protocol: 'https'
certificate_hash: '{{ thumbprint.thumbprints[0] }}'
state: 'present'
name: Ansible Tower
port: "443"
protocol: https
certificate_hash: "{{ thumbprint.thumbprints[0] }}"
state: present
notify: IIS_running
rescue:
- name: Configure site bindings twice due to WINRM issues
community.windows.win_iis_webbinding:
name: 'Ansible Tower'
port: '443'
protocol: 'https'
certificate_hash: '{{ thumbprint.thumbprints[0] }}'
state: 'present'
name: Ansible Tower
port: "443"
protocol: https
certificate_hash: "{{ thumbprint.thumbprints[0] }}"
state: present
notify: IIS_running

0 comments on commit 72b487e

Please sign in to comment.