Commit cb8bf743 authored by Maciej Delmanowski's avatar Maciej Delmanowski

Fix ansible-lint error E303 in DebOps roles

parent e4041448
......@@ -147,6 +147,8 @@
- name: Unload AppArmor profiles
command: service apparmor teardown
args:
warn: False
when: (not (apparmor__enabled|d() | bool))
- name: Ensure AppArmor service is stopped
......
---
- name: Reload systemd units
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: ansible_local|d() and ansible_local.init|d() and
ansible_local.init in [ 'systemd' ]
......
......@@ -182,8 +182,8 @@
tags: [ 'role::docker:config' ]
- name: Reload systemd daemons
command: systemctl daemon-reload
notify: [ 'Restart docker']
systemd:
daemon_reload: True
when: (ansible_service_mgr == 'systemd' and
((docker__register_systemd_service|d() and
docker__register_systemd_service is changed) or
......
......@@ -79,7 +79,8 @@
notify: [ 'Restart docker-gen' ]
- name: Reload systemd daemons
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: ((ansible_local|d() and ansible_local.init|d() and ansible_local.init == 'systemd') and
(docker_gen__register_service|d() and docker_gen__register_service is changed))
......
......@@ -73,6 +73,7 @@
command: git rev-parse {{ dokuwiki__git_version }}
args:
chdir: '{{ dokuwiki__git_dest }}'
warn: False
become: True
become_user: '{{ dokuwiki__user }}'
register: dokuwiki__register_target_branch
......
......@@ -50,7 +50,8 @@
register: elasticsearch__register_systemd
- name: Reload systemd daemons
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: (elasticsearch__register_systemd is changed and
ansible_service_mgr == 'systemd')
......
......@@ -88,6 +88,7 @@
command: git checkout --force {{ etherpad_version }}
args:
chdir: '{{ etherpad_src_dir + "/" + etherpad_repository }}'
warn: False
environment:
GIT_WORK_TREE: '{{ etherpad_home + "/" + etherpad_repository }}'
become: True
......@@ -175,7 +176,8 @@
when: ansible_service_mgr == 'systemd'
- name: Reload systemd daemons
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: (ansible_service_mgr == 'systemd' and
(etherpad__register_sysvinit is changed or
etherpad__register_systemd is changed))
......
......@@ -14,7 +14,8 @@
when: fcgiwrap__instances
- name: Reload systemd units
command: 'systemctl daemon-reload'
systemd:
daemon_reload: True
when: fcgiwrap__register_systemd is changed
- name: Enable and start systemd units
......
......@@ -13,6 +13,7 @@
command: git rev-parse HEAD
args:
chdir: '{{ gitlab__gitaly_dest }}'
warn: False
register: gitlab_register_gitaly_current_head
changed_when: False
become: True
......@@ -23,6 +24,7 @@
command: git symbolic-ref HEAD refs/heads/master
args:
chdir: '{{ gitlab__gitaly_dest }}'
warn: False
changed_when: False
become: True
become_user: '{{ gitlab_user }}'
......@@ -70,6 +72,7 @@
GIT_WORK_TREE: '{{ gitlab__gitaly_checkout }}'
args:
chdir: '{{ gitlab__gitaly_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_gitaly_target_tag
......@@ -81,6 +84,7 @@
GIT_WORK_TREE: '{{ gitlab__gitaly_checkout }}'
args:
chdir: '{{ gitlab__gitaly_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_gitlab__gitaly_checkout
......
......@@ -13,6 +13,7 @@
command: git rev-parse HEAD
args:
chdir: '{{ gitlab_pages_dest }}'
warn: False
register: gitlab_register_pages_current_head
changed_when: False
become: True
......@@ -24,6 +25,7 @@
command: git symbolic-ref HEAD refs/heads/master
args:
chdir: '{{ gitlab_pages_dest }}'
warn: False
changed_when: False
become: True
become_user: '{{ gitlab_user }}'
......@@ -78,6 +80,7 @@
GIT_WORK_TREE: '{{ gitlab_pages_checkout }}'
args:
chdir: '{{ gitlab_pages_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_pages_target_tag
......@@ -89,6 +92,7 @@
GIT_WORK_TREE: '{{ gitlab_pages_checkout }}'
args:
chdir: '{{ gitlab_pages_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_pages_checkout
......
......@@ -80,6 +80,7 @@
GIT_WORK_TREE: '{{ gitlab_shell_git_checkout }}'
args:
chdir: '{{ gitlab_shell_git_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_shell_target_tag
......@@ -91,6 +92,7 @@
GIT_WORK_TREE: '{{ gitlab_shell_git_checkout }}'
args:
chdir: '{{ gitlab_shell_git_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_shell_checkout
......
......@@ -13,6 +13,7 @@
command: git rev-parse HEAD
args:
chdir: '{{ gitlab_workhorse_dest }}'
warn: False
register: gitlab_register_gitlab_workhorse_current_head
changed_when: False
become: True
......@@ -23,6 +24,7 @@
command: git symbolic-ref HEAD refs/heads/master
args:
chdir: '{{ gitlab_workhorse_dest }}'
warn: False
changed_when: False
become: True
become_user: '{{ gitlab_user }}'
......@@ -75,6 +77,7 @@
GIT_WORK_TREE: '{{ gitlab_workhorse_checkout }}'
args:
chdir: '{{ gitlab_workhorse_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_gitlab_workhorse_target_tag
......@@ -86,6 +89,7 @@
GIT_WORK_TREE: '{{ gitlab_workhorse_checkout }}'
args:
chdir: '{{ gitlab_workhorse_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_gitlab_workhorse_checkout
......
......@@ -124,7 +124,8 @@
(gitlab_use_systemd is defined and gitlab_use_systemd))
- name: Reload systemd daemons
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: (ansible_service_mgr == "systemd" and
(gitlab__register_sysvinit_script is changed or
gitlab__register_systemd_services is changed or
......@@ -138,7 +139,9 @@
ansible_service_mgr != 'systemd' and not gitlab_use_systemd|bool)
- name: Enable GitLab SysVinit service (systemd)
command: systemctl enable gitlab
systemd:
name: 'gitlab'
enabled: True
when: (gitlab_register_ce_checkout is changed and
ansible_service_mgr == 'systemd' and not gitlab_use_systemd|bool)
......
......@@ -48,6 +48,7 @@
GIT_WORK_TREE: '{{ gitlab_ce_git_checkout }}'
args:
chdir: '{{ gitlab_ce_git_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_ce_target_branch
......@@ -65,6 +66,7 @@
GIT_WORK_TREE: '{{ gitlab_ce_git_checkout }}'
args:
chdir: '{{ gitlab_ce_git_dest }}'
warn: False
become: True
become_user: '{{ gitlab_user }}'
register: gitlab_register_ce_checkout
......
......@@ -114,7 +114,8 @@
item.name|d() and item.state|d('present') != 'absent'
- name: Reload systemd configuration
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: (ansible_service_mgr == 'systemd' and
(gunicorn__register_systemd_config is changed or
gunicorn__register_systemd_remove is changed or
......
......@@ -20,7 +20,8 @@
register: ifupdown__register_systemd_services
- name: Reload systemd services
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: ansible_service_mgr == 'systemd' and ifupdown__register_systemd_services is changed
## https://stackoverflow.com/a/28888474
......
......@@ -91,6 +91,7 @@
command: git rev-parse {{ netbox__git_version }}
args:
chdir: '{{ netbox__git_dest }}'
warn: False
become: True
become_user: '{{ netbox__user }}'
register: netbox__register_target_branch
......@@ -102,6 +103,7 @@
command: git checkout -f {{ netbox__git_version }}
args:
chdir: '{{ netbox__git_dest }}'
warn: False
become: True
become_user: '{{ netbox__user }}'
register: netbox__register_checkout
......@@ -235,7 +237,8 @@
when: netbox__app_internal_appserver|bool
- name: Reload systemd configuration
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: (ansible_service_mgr == 'systemd' and
netbox__register_systemd is changed)
......
......@@ -67,13 +67,14 @@
group: 'root'
mode: '0644'
register: opendkim__register_pid_socket
notify: [ 'Check opendkim and reload' ]
when: (ansible_service_mgr == 'systemd' and
ansible_distribution_release not in
[ 'wheezy', 'jessie', 'precise', 'trusty', 'xenial' ])
- name: Update systemd runtime configuration
command: systemctl daemon-reload
notify: [ 'Check opendkim and reload' ]
systemd:
daemon_reload: True
when: (ansible_service_mgr == 'systemd' and
ansible_distribution_release not in
[ 'wheezy', 'jessie', 'precise', 'trusty', 'xenial' ] and
......
......@@ -65,6 +65,7 @@
command: git rev-parse {{ phpipam_git_version }}
args:
chdir: '{{ phpipam_git_dest }}'
warn: False
become: True
become_user: '{{ phpipam_user }}'
register: phpipam_register_target_branch
......@@ -76,6 +77,7 @@
command: git checkout -f {{ phpipam_git_version }}
args:
chdir: '{{ phpipam_git_dest }}'
warn: False
become: True
become_user: '{{ phpipam_user }}'
register: phpipam_register_checkout
......
......@@ -103,7 +103,8 @@
when: proc_hidepid__enabled|bool and ansible_service_mgr == 'systemd'
- name: Reload systemd daemons
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: proc_hidepid__register_logind is changed
- name: Update Ansible facts if they were modified
......
......@@ -15,6 +15,8 @@
- name: Transfer the deploy key to Github
command: "curl --silent --header 'Authorization: token {{ rails_deploy_git_access_token }}' --data '{{ rails_deploy_key_data | to_nice_json }}' https://api.github.com/repos/{{ rails_deploy_git_account }}/{{ rails_deploy_git_repo }}/keys"
args:
warn: False
changed_when: False
when: rails_deploy_git_access_token and
'file://' not in rails_deploy_git_location and
......@@ -32,6 +34,8 @@
- name: Transfer the deploy key to Gitlab
command: "curl --insecure --header 'PRIVATE-TOKEN: {{ rails_deploy_git_access_token }}' --data '{{ rails_deploy_key_data | to_nice_json }}' https://{{ rails_deploy_git_host }}/api/v3/projects/{{ rails_deploy_register_gitlab_response.json.id }}/keys"
args:
warn: False
changed_when: False
register: foo
when: rails_deploy_git_access_token and
......
......@@ -24,7 +24,8 @@
notify: [ 'Restart inoticoming' ]
- name: Reload systemd configuration
command: systemctl daemon-reload
systemd:
daemon_reload: True
when: (ansible_service_mgr == 'systemd' and
reprepro_register_inotincoming_init is changed)
......
......@@ -34,6 +34,7 @@
command: git rev-parse HEAD
args:
chdir: '{{ roundcube__git_dest }}'
warn: False
become: True
become_user: '{{ roundcube__user }}'
register: roundcube__register_current_head
......@@ -44,6 +45,7 @@
command: git symbolic-ref HEAD refs/heads/master
args:
chdir: '{{ roundcube__git_dest }}'
warn: False
become: True
become_user: '{{ roundcube__user }}'
changed_when: False
......@@ -99,6 +101,7 @@
GIT_WORK_TREE: '{{ roundcube__git_checkout }}'
args:
chdir: '{{ roundcube__git_dest }}'
warn: False
become: True
become_user: '{{ roundcube__user }}'
register: roundcube__register_target_tag
......@@ -110,6 +113,7 @@
GIT_WORK_TREE: '{{ roundcube__git_checkout }}'
args:
chdir: '{{ roundcube__git_dest }}'
warn: False
become: True
become_user: '{{ roundcube__user }}'
register: roundcube__register_checkout
......
......@@ -9,6 +9,8 @@
- name: Get version of current Roundcube installation
command: sed -n "s/^define('RCMAIL_VERSION', '\(.*\)');/\1/p" \
{{ roundcube__git_checkout }}/program/include/iniset.php
args:
warn: False
changed_when: False
failed_when: False
register: roundcube__register_version
......@@ -22,6 +24,8 @@
/srv/www/roundcube/sites/{{
roundcube__domain if roundcube__domain is string
else roundcube__domain[0] }}/public/program/include/iniset.php
args:
warn: False
changed_when: False
failed_when: False
register: roundcube__register_version_old
......
......@@ -102,6 +102,7 @@
command: mount {{ item.home | default(sftpusers_default_home_prefix + "/" + item.name + sftpusers_name_suffix) }}/sites
args:
creates: '{{ item.home | default(sftpusers_default_home_prefix + "/" + item.name + sftpusers_name_suffix) }}/sites/{{ item.sites[0] }}'
warn: False
with_flattened:
- '{{ sftpusers_list }}'
- '{{ sftpusers_group_list }}'
......
......@@ -15,14 +15,15 @@
changed_when: False
- name: Create random temporary directory for ldif file
command: mktemp -d
tempfile:
state: 'directory'
register: slapd_register_tempdir
when: slapd_pki|d() and slapd_pki | bool and not (slapd_register_tls_cert_search.stdout is search("olcTLSCertificateFile:"))
- name: Prepare temporary ldif file
template:
src: 'tmp/configure_tlscerts.ldif.j2'
dest: '{{ slapd_register_tempdir.stdout|d() + "/configure_tlscerts.ldif" }}'
dest: '{{ slapd_register_tempdir.path|d() + "/configure_tlscerts.ldif" }}'
owner: 'root'
group: 'root'
mode: '0644'
......@@ -35,7 +36,7 @@
when: slapd_pki|d() and slapd_pki | bool and not (slapd_register_tls_cert_search.stdout is search("olcTLSCertificateFile:"))
- name: Configure TLS certificates (first time only)
command: 'ldapmodify -Y EXTERNAL -H ldapi:/// -f {{ slapd_register_tempdir.stdout|d() + "/configure_tlscerts.ldif" }}'
command: 'ldapmodify -Y EXTERNAL -H ldapi:/// -f {{ slapd_register_tempdir.path|d() + "/configure_tlscerts.ldif" }}'
when: slapd_pki|d() and slapd_pki | bool and not (slapd_register_tls_cert_search.stdout is search("olcTLSCertificateFile:"))
- name: Configure TLS certificates
......
......@@ -41,7 +41,10 @@
notify: [ 'Restart snmpd' ]
- name: Reload systemd daemon and enable snmpd.service
shell: systemctl daemon-reload ; systemctl enable snmpd.service
systemd:
daemon_reload: True
name: 'snmpd.service'
enabled: True
when: ((ansible_local|d() and ansible_local.init|d() and
ansible_local.init == "systemd") and not ansible_local.snmpd|d())
......
......@@ -294,7 +294,10 @@
when: tinc__systemd | bool
- name: Reload systemd daemon configuration
shell: systemctl daemon-reload ; systemctl enable tinc.service
systemd:
daemon_reload: True
name: 'tinc.service'
enabled: True
when: tinc__register_systemd is changed
- name: Start tinc VPN networks on first install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment