Skip to content

Commit

Permalink
Ansible linting errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmirnow committed Jan 10, 2025
1 parent fd7d71c commit c6b51bb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: reload nginx
- name: Reload nginx
ansible.builtin.service:
name: nginx
state: reloaded
6 changes: 3 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ galaxy_info:
company: ELAN e.V.
description: Installs and prepares Nginx for Opencast
license: BSD-3-Clause
min_ansible_version: 2.9
min_ansible_version: "2.9"
galaxy_tags:
- opencast
platforms:
- name: EL
versions:
- 8
- 9
- "8"
- "9"
- name: Debian
versions:
- bullseye
Expand Down
10 changes: 5 additions & 5 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
hosts: all
gather_facts: false
tasks:
- name: test that nginx redirects to https
- name: Test that nginx redirects to https
ansible.builtin.uri:
url: http://127.0.0.1/
follow_redirects: none
status_code: 301

- name: test that nginx acts as proxy on https
- name: Test that nginx acts as proxy on https
ansible.builtin.uri:
url: https://127.0.0.1/
validate_certs: false
follow_redirects: none
status_code: 502

- name: add extra configuration
- name: Add extra configuration
ansible.builtin.copy:
content: 'location /test { return 204; }'
dest: /etc/nginx/conf.d/extra.conf
mode: '0644'

- name: reload nginx
- name: Reload nginx
ansible.builtin.service:
name: nginx
state: reloaded

- name: test extra configuration
- name: Test extra configuration
ansible.builtin.uri:
url: https://127.0.0.1/test
validate_certs: false
Expand Down
22 changes: 11 additions & 11 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---

- name: install nginx
- name: Install nginx
ansible.builtin.package:
name: nginx
state: present

- name: create configuration directories
- name: Create configuration directories
ansible.builtin.file:
path: /etc/nginx/{{ item }}
state: directory
Expand All @@ -16,52 +16,52 @@
- ssl
- conf.d

- name: configure nginx for opencast
- name: Configure nginx for opencast
ansible.builtin.template:
src: '{{ item }}'
dest: /etc/nginx/{{ item }}
mode: '0644'
owner: root
group: root
notify: reload nginx
notify: Reload nginx
loop:
- nginx.conf
- conf.d/tls.conf
- conf.d/http.conf

- name: generate diffie-hellman parameters
- name: Generate diffie-hellman parameters
community.crypto.openssl_dhparam:
path: /etc/nginx/ssl/dhparam.pem
size: 2048
mode: '0640'
owner: root
group: root
notify: reload nginx
notify: Reload nginx

- name: create extra configuration file
- name: Create extra configuration file
ansible.builtin.copy:
src: extra.conf
dest: /etc/nginx/conf.d/extra.conf
owner: root
group: root
mode: '0644'
force: false
notify: reload nginx
notify: Reload nginx

- name: install dummy tls certificate
- name: Install dummy tls certificate
ansible.builtin.copy:
src: dummy-tls-{{ item }}.pem
dest: /etc/nginx/ssl/{{ inventory_hostname }}.{{ item }}
owner: root
group: root
mode: '0400'
force: false
notify: reload nginx
notify: Reload nginx
loop:
- key
- crt

- name: enable nginx
- name: Enable nginx
ansible.builtin.service:
name: nginx
enabled: true
Expand Down

0 comments on commit c6b51bb

Please sign in to comment.