Commit 819906b2 authored by Maciej Delmanowski's avatar Maciej Delmanowski

Fix ansible-lint error E602 in DebOps roles

parent 7567fcab
......@@ -84,13 +84,13 @@
fi
done
register: apparmor__register_enforce_all_profiles
changed_when: (apparmor__register_enforce_all_profiles.stdout != "")
changed_when: (apparmor__register_enforce_all_profiles.stdout|d())
when: (apparmor__enforce_all_profiles|d() | bool)
- name: Set profile status
command: aa-{{ item.value }} "{{ item.key }}"
register: apparmor__register_profile_status
# changed_when: (apparmor__register_profile_status.stdout|d() != "")
# changed_when: (apparmor__register_profile_status.stdout|d())
## FIXME: Currently changed_when seems to be tricky.
changed_when: False
failed_when: |
......
......@@ -52,7 +52,7 @@
failed_when: False
changed_when: False
check_mode: False
when: snapshot_snapper__directory != "" and "mlocate" in snapshot_snapper__combined_packages
when: snapshot_snapper__directory|d() and "mlocate" in snapshot_snapper__combined_packages
register: snapshot_snapper__register_updatedb_configured
- name: Configure updatedb to exclude snapshots
......
......@@ -65,7 +65,7 @@
- '{{ apt_install__group_alternatives }}'
- '{{ apt_install__host_alternatives }}'
when: item.name|d() and not item.path|d()
changed_when: apt_install__register_alternatives.stdout != ''
changed_when: apt_install__register_alternatives.stdout|d()
- name: Make sure that Ansible fact directory exists
file:
......
......@@ -44,7 +44,7 @@
dest: '{{ debops__project_name if debops__project_name else debops__project_git_repo | basename }}'
version: 'master'
update: True
when: debops__project_git_repo != ''
when: debops__project_git_repo|d()
- name: Initialize new project
become: '{{ debops__install_systemwide|bool }}'
......@@ -52,4 +52,4 @@
args:
creates: '{{ debops__project_name }}/.debops.cfg'
when: debops__project_name|d() and
debops__project_git_repo == ''
not debops__project_git_repo|d()
......@@ -88,7 +88,7 @@
mode: '0755'
with_items: '{{ icinga__combined_configuration | parse_kv_items }}'
when: (item.name|d() and item.state|d('present') not in [ 'absent', 'ignore', 'init', 'feature' ] and
((item.filename | d(item.name | regex_replace(".conf$","") + ".conf")) | dirname != ''))
((item.filename | d(item.name | regex_replace(".conf$","") + ".conf")) | dirname | d()))
- name: Remove Icinga configuration if requested
file:
......
......@@ -45,7 +45,7 @@
become_user: '{{ owncloud__app_user }}'
## https://github.com/debops/ansible-owncloud/issues/62
when: (owncloud__occ_item|d() and
owncloud__occ_item.command|d("") != "" and
owncloud__occ_item.command|d() and
(owncloud__occ_item.when|d(True) | bool) and not (
ansible_local|d() and ansible_local.owncloud|d() and
ansible_local.owncloud.maintenance|d() | bool and (
......
......@@ -86,7 +86,7 @@
- name: Determine if ownCloud autosetup should be done
set_fact:
owncloud__do_autosetup: '{{ (owncloud__autosetup and
owncloud__admin_username != "" and
owncloud__admin_username|d() and
(owncloud__register_occ_check is not skipped) and
"is not installed" in owncloud__register_occ_check.stdout) }}'
......
......@@ -17,7 +17,7 @@
file:
path: '{{ owncloud__deploy_path + "/themes/" + owncloud__theme_directory_name }}'
state: 'directory'
when: (owncloud__theme_directory_name != "")
when: (owncloud__theme_directory_name|d())
tags:
- 'role::owncloud:theme:common_settings'
......@@ -30,7 +30,7 @@
group: '{{ owncloud__app_group }}'
mode: '0640'
validate: 'php -f %s'
when: (owncloud__theme_directory_name != "")
when: (owncloud__theme_directory_name|d())
tags: [ 'role::owncloud:theme:common_settings' ]
- name: Ensure that parent directories exist
......@@ -41,7 +41,7 @@
group: '{{ item.value.base_directory_group | d(omit) }}'
mode: '{{ item.value.base_directory_mode | d(omit) }}'
with_dict: '{{ owncloud__theme_copy_files_combined }}'
when: (owncloud__theme_directory_name != "" and item.value.state|d("present") == "present")
when: (owncloud__theme_directory_name|d() and item.value.state|d("present") == "present")
tags: [ 'role::owncloud:theme:copy' ]
- name: Copy additional theme files
......@@ -62,7 +62,7 @@
src: '{{ item.value.src | d(omit) }}'
validate: '{{ item.value.validate | d(omit) }}'
with_dict: '{{ owncloud__theme_copy_files_combined }}'
when: (owncloud__theme_directory_name != "" and item.value.state|d("present") == "present")
when: (owncloud__theme_directory_name|d() and item.value.state|d("present") == "present")
tags: [ 'role::owncloud:theme:copy' ]
- name: Activate custom theme
......@@ -72,7 +72,7 @@
owner: 'root'
group: '{{ owncloud__app_group }}'
mode: '0640'
when: (owncloud__theme_active != "")
when: (owncloud__theme_active|d())
tags: [ 'role::owncloud:theme:activate' ]
# .. ]]]
......@@ -83,14 +83,14 @@
file:
path: '{{ owncloud__deploy_path }}/config/theme.config.php'
state: 'absent'
when: (owncloud__theme_active == "")
when: (not owncloud__theme_active|d())
tags: [ 'role::owncloud:theme:activate' ]
- name: Delete additional theme files
file:
path: '{{ owncloud__deploy_path + "/themes/" + owncloud__theme_directory_name + "/" + item.key }}'
state: 'absent'
when: (owncloud__theme_directory_name != "" and item.value.state|d("present") == "absent")
when: (owncloud__theme_directory_name|d() and item.value.state|d("present") == "absent")
with_dict: '{{ owncloud__theme_copy_files_combined }}'
tags: [ 'role::owncloud:theme:copy' ]
......
......@@ -100,7 +100,7 @@
script: script/php-synchronize-config.sh {{ php__version }}
register: php__register_synchronize_config
changed_when: php__register_synchronize_config.stdout is defined and
php__register_synchronize_config.stdout != ''
php__register_synchronize_config.stdout|d()
notify: [ 'Restart php-fpm' ]
tags: [ 'role::php:config' ]
......
......@@ -371,7 +371,7 @@
become: False
run_once: True
when: (pki_authorities or pki_dependent_authorities)
changed_when: pki_register_sign_by_host.stdout != ""
changed_when: pki_register_sign_by_host.stdout|d()
# ]]]
# Download files [[[
......
......@@ -76,7 +76,7 @@
command: usermod --add-subuids {{ (item|string + "-" + (item|int + root_account__subuid_count|int)|string) }}
--add-subgids {{ (item|string + "-" + (item|int + root_account__subuid_count|int)|string) }} root
with_items: '{{ root_account__subuid_start }}'
when: root_account__enabled|bool and root_account__subuid_enabled|bool and root_account__register_subuid.stdout == ''
when: root_account__enabled|bool and root_account__subuid_enabled|bool and not root_account__register_subuid.stdout|d()
- name: Fix shell usage without TTY present
lineinfile:
......
......@@ -25,7 +25,7 @@
changed_when: False
failed_when: False
register: roundcube__register_version_old
when: (roundcube__register_version.stdout == '') and
when: (not roundcube__register_version.stdout|d()) and
(not roundcube__git_checkout == '/srv/www/roundcube/sites/'
+ (roundcube__domain if roundcube__domain is string
else roundcube__domain[0]) + '/public')
......@@ -84,11 +84,11 @@
become: True
become_user: '{{ roundcube__user }}'
register: roundcube__register_updatedb
changed_when: not roundcube__register_updatedb.stdout == ''
when: (not roundcube__register_version.stdout == '' and
changed_when: roundcube__register_updatedb.stdout|d()
when: (roundcube__register_version.stdout|d() and
roundcube__git_version is version_compare(roundcube__register_version.stdout, '>')) or
(roundcube__register_version_old is not skipped and
not roundcube__register_version_old.stdout == '')
roundcube__register_version_old.stdout|d())
tags: [ 'role::roundcube:database' ]
- name: Post hooks
......
......@@ -50,7 +50,7 @@
done
register: rsyslog__register_file_permissions
when: rsyslog__unprivileged|bool
changed_when: rsyslog__register_file_permissions.stdout != ''
changed_when: rsyslog__register_file_permissions.stdout|d()
notify: [ 'Restart rsyslogd' ]
- name: Divert main rsyslog configuration
......
......@@ -48,7 +48,7 @@
with_items: '{{ slapd_ldap_schema }}'
register: slapd_register_load_schema
when: slapd_ldap_schema is defined and slapd_ldap_schema
changed_when: slapd_register_load_schema.stdout != ""
changed_when: slapd_register_load_schema.stdout|d()
- include: password_config_admin.yml
- include: password_basedn_admin.yml
......
......@@ -13,15 +13,15 @@
- name: Stop smsd for home directory change
service: name=smstools state=stopped
when: smstools_register_home is defined and smstools_register_home.stdout != ""
when: smstools_register_home is defined and smstools_register_home.stdout|d()
- name: Fix smsd home directory
user: name=smsd home=/var/spool/sms
when: smstools_register_home is defined and smstools_register_home.stdout != ""
when: smstools_register_home is defined and smstools_register_home.stdout|d()
- name: Start smsd with new home directory
service: name=smstools state=started
when: smstools_register_home is defined and smstools_register_home.stdout != ""
when: smstools_register_home is defined and smstools_register_home.stdout|d()
- name: Configure smsd
template: src=etc/smsd.conf.j2 dest=/etc/smsd.conf
......
......@@ -58,7 +58,7 @@
- name: Apply kernel parameters if they were modified
shell: |
{% if (sysctl__register_system.stdout != '') %}
{% if (sysctl__register_system.stdout|d()) %}
sysctl --system
{% else %}
sysctl -e -p $(find /etc/sysctl.d -mindepth 1 -maxdepth 1 -name '*.conf' -print0 | sort -z | xargs -r0) /etc/sysctl.conf
......
......@@ -32,7 +32,7 @@
if users__dotfiles_combined_map[item.dotfiles_name | d(users__dotfiles_name)].creates|d()
else omit) }}'
register: users__register_dotfiles_command
changed_when: users__register_dotfiles_command.stdout != '' and
changed_when: users__register_dotfiles_command.stdout|d() and
not users__register_dotfiles_command.stdout.startswith('skipped, since ')
with_flattened:
- '{{ users__root_accounts }}'
......
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