Skip to content

Commit

Permalink
Linting fixes for new ansible-lint version
Browse files Browse the repository at this point in the history
  • Loading branch information
stsnel committed May 17, 2023
1 parent 786ac07 commit b2c0ea8
Show file tree
Hide file tree
Showing 25 changed files with 46 additions and 39 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ skip_list:
- no-changed-when # Commands should not change things if nothing needs doing
- no-handler # Tasks that run when changed should likely be handlers
- experimental # all rules tagged as experimental
- schema[meta]
2 changes: 1 addition & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
- solr
- redis
- ckan
- msl-api
- msl_api
2 changes: 1 addition & 1 deletion roles/acme_certificates/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
author: Lazlo Westerhof
description: Install Let's Encrypt certificates
license: GPLv3
min_ansible_version: 2.7
min_ansible_version: "2.7"
platforms:
- name: CentOS
version: 7
8 changes: 4 additions & 4 deletions roles/certificates/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
dest: '{{ openssl_certs_dir }}/{{ openssl_crt_signed_and_chain }}'
owner: root
group: root
mode: 0644
mode: "0644"
when: cert_mode == "static"


Expand Down Expand Up @@ -94,7 +94,7 @@
content: '{{ static_cert_crt }}'
owner: root
group: root
mode: 0644
mode: "0644"
when: cert_mode == "static"


Expand All @@ -104,7 +104,7 @@
content: '{{ static_cert_chain }}'
owner: root
group: root
mode: 0644
mode: "0644"
when: cert_mode == "static"


Expand Down Expand Up @@ -137,7 +137,7 @@
- name: Ensure certificate files have correct permissions
ansible.builtin.file:
path: '{{ item }}'
mode: 0644
mode: "0644"
group: 'root'
owner: 'root'
state: file
Expand Down
12 changes: 6 additions & 6 deletions roles/ckan/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ galaxy_info:
# - CC-BY
license: GPLv3

min_ansible_version: 2.7
min_ansible_version: "2.7"

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
Expand Down Expand Up @@ -62,8 +62,8 @@ galaxy_info:


dependencies:
- common
- solr
- redis
- postgresql
- nginx
- role: common
- role: solr
- role: redis
- role: postgresql
- role: nginx
10 changes: 5 additions & 5 deletions roles/ckan/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
state: directory
owner: www-data
group: www-data
mode: 0775
mode: "0775"


- name: Install CKAN package
Expand Down Expand Up @@ -92,7 +92,7 @@
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
mode: "0755"
owner: root
with_items:
- /usr/lib/ckan
Expand Down Expand Up @@ -131,7 +131,7 @@
dest: "{{ ckan_ini_file }}"
owner: www-data
group: www-data
mode: 0644
mode: "0644"
when: not ansible_check_mode


Expand All @@ -154,7 +154,7 @@
dest: /etc/solr/conf/schema.xml
owner: root
group: root
mode: 0644
mode: "0644"
notify: Restart Solr


Expand Down Expand Up @@ -290,7 +290,7 @@
dest: "/etc/nginx/sites-available/ckan"
owner: root
group: root
mode: 0644
mode: "0644"
notify: Restart Nginx webserver


Expand Down
5 changes: 4 additions & 1 deletion roles/common/tasks/apt_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# copyright Utrecht University

- name: Update apt cache
ansible.builtin.apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
ansible.builtin.apt:
update_cache: true
force_apt_get: true
cache_valid_time: 3600
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ansible.builtin.file:
path: /var/www/msl_api
state: directory
mode: 0755
mode: "0755"


- name: Ensure MSL API dir is writable for Composer
Expand Down Expand Up @@ -64,5 +64,5 @@
dest: /etc/supervisor/conf.d/laravel-worker.conf
owner: root
group: root
mode: 0644
mode: "0644"
notify: Reload Supervisor
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
checksum: '{{ composer_checksum }}'
group: root
owner: root
mode: 0755
mode: "0755"
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions roles/postgresql/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ galaxy_info:
# - CC-BY
license: GPLv3

min_ansible_version: 2.7
min_ansible_version: "2.7"

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
Expand Down Expand Up @@ -61,5 +61,5 @@ galaxy_info:
# Maximum 20 tags per role.

dependencies:
- common
- certificates
- role: common
- role: certificates
4 changes: 2 additions & 2 deletions roles/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
- name: Ensure PostgreSQL has access to PKI files
ansible.builtin.file:
path: '{{ item }}'
mode: 0600
mode: "0600"
group: 'postgres'
owner: 'postgres'
state: file
Expand All @@ -71,7 +71,7 @@
section: null
option: '{{ item.option }}'
value: '{{ item.value }}'
mode: 0644
mode: "0644"
with_items:
- option: ssl
value: "on"
Expand Down
2 changes: 1 addition & 1 deletion roles/redis/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ansible.builtin.template:
src: redis.conf.j2
dest: /etc/redis.conf
mode: 0644
mode: "0644"
notify: Restart Redis


Expand Down
2 changes: 1 addition & 1 deletion roles/solr/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
dest: /etc/tomcat9/server.xml
owner: root
group: tomcat
mode: 0640
mode: "0640"
register: serverxml


Expand Down
7 changes: 4 additions & 3 deletions roles/zabbix_agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
url: "{{ zabbix_agent.url }}/{{ zabbix_agent.filename }}"
dest: '{{ zabbix_agent.deb_dest_dir }}/{{ zabbix_agent.filename }}'
checksum: '{{ zabbix_agent.checksum }}'
mode: "0644"


- name: Install Zabbix repo from downloaded package
Expand All @@ -22,7 +23,7 @@
dest: /etc/apt/preferences.d/99zabbix-agent
owner: root
group: root
mode: 0644
mode: "0644"


- name: Install Zabbix agent"
Expand Down Expand Up @@ -50,7 +51,7 @@
path: /etc/zabbix/zabbix_agentd.psk
owner: zabbix
group: zabbix
mode: 0600
mode: "0600"


- name: Configure Zabbix agent
Expand All @@ -59,5 +60,5 @@
dest: /etc/zabbix/zabbix_agentd.conf
owner: zabbix
group: zabbix
mode: 0600
mode: "0600"
notify: Restart Zabbix agent
6 changes: 3 additions & 3 deletions roles/zabbix_ckan/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
dest: '/etc/zabbix/zabbix_agentd.conf.d/{{ item }}'
owner: zabbix
group: zabbix
mode: 0500
mode: "0500"
with_items:
- 'dailyErrorLog.sh'

Expand All @@ -18,7 +18,7 @@
dest: '/etc/zabbix/zabbix_agentd.conf.d/zabbix_agentd.userparams.conf'
owner: zabbix
group: zabbix
mode: 0400
mode: "0400"


- name: Ensure Zabbix sudoers file is present
Expand All @@ -27,4 +27,4 @@
dest: '/etc/sudoers.d/ckan-zabbix-sudoers'
owner: root
group: root
mode: 0440
mode: "0440"
9 changes: 5 additions & 4 deletions roles/zabbix_postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ansible.builtin.get_url:
url: 'https://github.com/zabbix/zabbix/archive/refs/tags/{{ zabbix_source_version }}.tar.gz'
dest: '/tmp/zabbix-{{ zabbix_source_version }}.tar.gz'
mode: "0644"


- name: Extract Zabbix source code
Expand All @@ -20,7 +21,7 @@
path: '{{ item }}'
owner: zabbix
group: zabbix
mode: 0755
mode: "0755"
state: directory
with_items:
- /var/lib/zabbix
Expand All @@ -43,14 +44,14 @@
dest: /etc/zabbix/zabbix_agentd.conf.d/template_db_postgresql.conf
owner: zabbix
group: zabbix
mode: 0640
mode: "0640"
no_log: true


- name: Create Zabbix database user
become_user: postgres
become: true
postgresql_user:
community.postgresql.postgresql_user:
db: "{{ zabbix_database_name }}"
name: "{{ zabbix_psql_monitoring_user }}"
password: "{{ zabbix_psql_monitoring_password }}"
Expand All @@ -61,7 +62,7 @@
- name: Grant Zabbix user select rights on postgres database
become: true
become_user: postgres
postgresql_privs:
community.postgresql.postgresql_privs:
db: "{{ zabbix_psql_monitoring_db }}"
role: "{{ zabbix_psql_monitoring_user }}"
objs: ALL_IN_SCHEMA
Expand Down
3 changes: 2 additions & 1 deletion zabbix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# copyright Utrecht University
# This playbook provisions EPOS-MSL instance with the Zabbix agent, PostgreSQL monitoring and Zabbix user access to the database.

- hosts: localhost
- name: Local checks
hosts: localhost
gather_facts: false
pre_tasks:
- name: Verify Ansible version meets requirements
Expand Down

0 comments on commit b2c0ea8

Please sign in to comment.