Skip to content

Commit

Permalink
Improve Jinja2 spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
wbclark committed Aug 29, 2022
1 parent a314a20 commit 32250be
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion roles/fips/tasks/el7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- name: 'Generate boot=UUID=XXXX kernel command'
ansible.builtin.set_fact:
boot_cmd: "boot=UUID={{ boot_mount[0]['uuid'] }}"
when: boot_mount|length > 0
when: boot_mount | length > 0

- name: 'Edit kernel command-line to include the fips=1 and boot=UUID=XXXX argument'
ansible.builtin.shell: 'grubby --update-kernel=DEFAULT --args="fips=1 {{ boot_cmd | default() }}"'
8 changes: 4 additions & 4 deletions roles/foreman_installer/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

- name: 'Run installer'
ansible.builtin.shell: >
{{ foreman_installer_command }} {{ (foreman_installer_verbose|bool) | ternary("-v", "") }}
{{ (foreman_installer_no_colors|bool) | ternary("--no-colors", "") }}
{{ (foreman_installer_version is version('3.4', '<') and foreman_installer_disable_system_checks|bool) | ternary("--disable-system-checks", "") }}
{{ (foreman_installer_version is version('3.4', '>=') and foreman_installer_disable_system_checks|bool and foreman_installer_scenario in ['katello']) | ternary("--tuning development", "") }}
{{ foreman_installer_command }} {{ (foreman_installer_verbose | bool) | ternary("-v", "") }}
{{ (foreman_installer_no_colors | bool) | ternary("--no-colors", "") }}
{{ (foreman_installer_version is version('3.4', '<') and foreman_installer_disable_system_checks | bool) | ternary("--disable-system-checks", "") }}
{{ (foreman_installer_version is version('3.4', '>=') and foreman_installer_disable_system_checks | bool and foreman_installer_scenario in ['katello']) | ternary("--tuning development", "") }}
{{ foreman_installer_scenario_flag }} {{ foreman_installer_scenario }}
{{ foreman_installer_options_joined }}
when: not foreman_installer_skip_installer
Expand Down
2 changes: 1 addition & 1 deletion roles/foreman_installer/tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

- name: 'Set internal installer options'
ansible.builtin.set_fact:
foreman_installer_options_internal_use_only: "{{ [ '--upgrade', '--certs-update-all' ] + foreman_installer_options_internal_use_only }}"
foreman_installer_options_internal_use_only: "{{ ['--upgrade', '--certs-update-all'] + foreman_installer_options_internal_use_only }}"
when:
- foreman_installer_version is version('2.1', '<')
- foreman_installer_scenario != 'foreman'
Expand Down
4 changes: 2 additions & 2 deletions roles/foreman_provisioning/tasks/configure_centos_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- name: 'Get CentOS 7 info'
ansible.builtin.set_fact:
foreman_provisioning_centos73: "{{ foreman_provisioning_centos73_json.stdout|from_json }}"
foreman_provisioning_centos73: "{{ foreman_provisioning_centos73_json.stdout | from_json }}"

- name: 'Find kickstart templates'
ansible.builtin.shell: >
Expand All @@ -27,7 +27,7 @@

- name: 'Set kickstart templates'
ansible.builtin.set_fact:
kickstart_templates: "{{ kickstart_templates_json.stdout|from_json }}"
kickstart_templates: "{{ kickstart_templates_json.stdout | from_json }}"

- name: 'Associate kickstart templates to CentOS 7'
ansible.builtin.shell: >
Expand Down
4 changes: 2 additions & 2 deletions roles/foreman_provisioning/tasks/configure_debian_9_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- name: 'Get CentOS 9.3 info'
ansible.builtin.set_fact:
foreman_provisioning_debian93: "{{ foreman_provisioning_debian93_json.stdout|from_json }}"
foreman_provisioning_debian93: "{{ foreman_provisioning_debian93_json.stdout | from_json }}"

- name: 'Find preseed templates'
ansible.builtin.shell: >
Expand All @@ -23,7 +23,7 @@

- name: 'Set preseed templates'
ansible.builtin.set_fact:
preseed_templates: "{{ preseed_templates_json.stdout|from_json }}"
preseed_templates: "{{ preseed_templates_json.stdout | from_json }}"

- name: 'Associate preseed templates to Debian 9.3'
ansible.builtin.shell: >
Expand Down
4 changes: 2 additions & 2 deletions roles/foreman_provisioning/tasks/configure_fedora_27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- name: 'Get Fedora 27 info'
ansible.builtin.set_fact:
foreman_provisioning_fedora27: "{{ foreman_provisioning_fedora27_json.stdout|from_json }}"
foreman_provisioning_fedora27: "{{ foreman_provisioning_fedora27_json.stdout | from_json }}"

- name: 'Find kickstart templates'
ansible.builtin.shell: >
Expand All @@ -23,7 +23,7 @@

- name: 'Set kickstart templates'
ansible.builtin.set_fact:
kickstart_templates: "{{ kickstart_templates_json.stdout|from_json }}"
kickstart_templates: "{{ kickstart_templates_json.stdout | from_json }}"

- name: 'Associate kickstart templates to Fedora 27'
ansible.builtin.shell: >
Expand Down
4 changes: 2 additions & 2 deletions roles/foreman_provisioning/tasks/configure_ubuntu_17_10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- name: 'Get Ubuntu 17.10 info'
ansible.builtin.set_fact:
foreman_provisioning_ubuntu1710: "{{ foreman_provisioning_ubuntu1710_json.stdout|from_json }}"
foreman_provisioning_ubuntu1710: "{{ foreman_provisioning_ubuntu1710_json.stdout | from_json }}"

- name: 'Find preseed templates'
ansible.builtin.shell: >
Expand All @@ -23,7 +23,7 @@

- name: 'Set preseed templates'
ansible.builtin.set_fact:
preseed_templates: "{{ preseed_templates_json.stdout|from_json }}"
preseed_templates: "{{ preseed_templates_json.stdout | from_json }}"

- name: 'Associate preseed templates to Ubuntu 17.10'
ansible.builtin.shell: >
Expand Down
2 changes: 1 addition & 1 deletion roles/foreman_provisioning_infrastructure/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: 'Set smart proxy id'
ansible.builtin.set_fact:
foreman_provisioning_smart_proxy: "{{ foreman_provisioning_smart_proxy_json.stdout|from_json }}"
foreman_provisioning_smart_proxy: "{{ foreman_provisioning_smart_proxy_json.stdout | from_json }}"

- name: 'Refresh features'
ansible.builtin.shell: >
Expand Down
22 changes: 11 additions & 11 deletions roles/foreman_seeder/hostgroups/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
- name: 'Create operating systems'
ansible.builtin.shell: >
{% if 'minor' in item %}
{% set title = item.name +' '+ item.major +'.'+ item.minor %}
{% set title = item.name + ' ' + item.major + '.' + item.minor %}
{% else %}
{% set title = item.name +' '+ item.major %}
{% set title = item.name + ' ' + item.major %}
{% endif %}
{{ foreman_seeder_hostgroups_hammer }} --output=silent os info --name "{{ title }}" ||
{{ foreman_seeder_hostgroups_hammer }} --output=silent os info --title "{{ title }}" ||
Expand Down Expand Up @@ -53,7 +53,7 @@

- name: 'Set kickstart templates'
ansible.builtin.set_fact:
kickstart_templates: "{{ kickstart_templates_json.stdout|from_json }}"
kickstart_templates: "{{ kickstart_templates_json.stdout | from_json }}"
tags:
- seed

Expand All @@ -67,16 +67,16 @@

- name: 'Set preseed templates'
ansible.builtin.set_fact:
preseed_templates: "{{ preseed_templates_json.stdout|from_json }}"
preseed_templates: "{{ preseed_templates_json.stdout | from_json }}"
tags:
- seed

- name: 'Associate kickstart templates to operating systems'
ansible.builtin.shell: >
{% if 'minor' in item[0] %}
{% set title = item[0].name +' '+ item[0].major +'.'+ item[0].minor %}
{% set title = item[0].name + ' ' + item[0].major + '.' + item[0].minor %}
{% else %}
{% set title = item[0].name +' '+ item[0].major %}
{% set title = item[0].name + ' ' + item[0].major %}
{% endif %}
{% if item[0].family == 'Redhat' %}
{{ foreman_seeder_hostgroups_hammer }} template add-operatingsystem --id {{ item[1].Id }} --operatingsystem '{{ title }}'
Expand All @@ -92,9 +92,9 @@
- name: 'Associate preseed templates to operating systems'
ansible.builtin.shell: >
{% if 'minor' in item[0] %}
{% set title = item[0].name +' '+ item[0].major +'.'+ item[0].minor %}
{% set title = item[0].name + ' ' + item[0].major + '.' + item[0].minor %}
{% else %}
{% set title = item[0].name +' '+ item[0].major %}
{% set title = item[0].name + ' ' + item[0].major %}
{% endif %}
{% if item[0].family == 'Debian' %}
{{ foreman_seeder_hostgroups_hammer }} template add-operatingsystem --id {{ item[1].Id }} --operatingsystem '{{ title }}'
Expand All @@ -121,11 +121,11 @@
- name: 'Create hostgroups'
ansible.builtin.shell: >
{% if 'minor' in item %}
{% set os_title = item.name +' '+ item.major +'.'+ item.minor %}
{% set os_title = item.name + ' ' + item.major + '.' + item.minor %}
{% else %}
{% set os_title = item.name +' '+ item.major %}
{% set os_title = item.name + ' ' + item.major %}
{% endif %}
{% set name = 'Forklift '+ os_title %}
{% set name = 'Forklift ' + os_title %}
{{ foreman_seeder_hostgroups_hammer }} --output=silent hostgroup info --name "{{ name }}" ||
{{ foreman_seeder_hostgroups_hammer }} hostgroup create
--name '{{ name }}'
Expand Down
8 changes: 4 additions & 4 deletions roles/foreman_server_repositories/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
ansible.builtin.include_role:
role: theforeman.operations.puppet_repositories
when:
- foreman_server_repositories_puppet|bool
- foreman_server_repositories_puppet | bool

- name: Load foreman_repositories
ansible.builtin.include_role:
role: foreman_repositories
when: foreman_server_repositories_foreman|bool
when: foreman_server_repositories_foreman | bool

- name: Load katello_repositories
ansible.builtin.include_role:
role: katello_repositories
when: foreman_server_repositories_katello|bool
when: foreman_server_repositories_katello | bool

- name: Load foreman_client_repositories
ansible.builtin.include_role:
role: foreman_client_repositories
when: foreman_server_repositories_foreman_client|bool
when: foreman_server_repositories_foreman_client | bool
2 changes: 1 addition & 1 deletion roles/forklift/tasks/destroy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: 'Destroy boxes'
ansible.builtin.command: "vagrant destroy -f {{ forklift_boxes.keys()|join(' ') }}"
ansible.builtin.command: "vagrant destroy -f {{ forklift_boxes.keys() | join(' ') }}"
args:
chdir: "{{ forklift_directory }}"

Expand Down
2 changes: 1 addition & 1 deletion roles/forklift/tasks/halt.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: 'Halt boxes'
ansible.builtin.command: "vagrant halt {{ forklift_boxes.keys()|join(' ') }}"
ansible.builtin.command: "vagrant halt {{ forklift_boxes.keys() | join(' ') }}"
args:
chdir: "{{ forklift_directory }}"
2 changes: 1 addition & 1 deletion roles/forklift/tasks/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# using --no-parallel here to avoid problems with libvirt storage volumes
# see https://github.com/vagrant-libvirt/vagrant-libvirt/issues/850
- name: 'Bring up boxes'
ansible.builtin.command: "vagrant up --no-parallel {{ forklift_boxes.keys()|join(' ') }}"
ansible.builtin.command: "vagrant up --no-parallel {{ forklift_boxes.keys() | join(' ') }}"
args:
chdir: "{{ forklift_directory }}"
2 changes: 1 addition & 1 deletion roles/freeipa_server/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
server_group: "server-{{ inventory_hostname }}"
katello_server_origin: "{{ groups[server_group][0] }}"
katello_server: "{{ katello_server_origin.replace('centos','c') }}"
katello_server: "{{ katello_server_origin.replace('centos', 'c') }}"
katello_server_ip: "{{ hostvars[katello_server_origin]['ansible_host'] }}"

freeipa_server_ip: "{{ ansible_eth0.ipv4.address }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/katello_provisioning/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
katello_provisioning_hammer: hammer
katello_provisioning_organization: Default Organization
katello_provisioning_organization_label: "{{ katello_provisioning_organization|regex_replace('\\s', '_') }}"
katello_provisioning_organization_label: "{{ katello_provisioning_organization | regex_replace('\\s', '_') }}"
katello_provisioning_location: Default Location
katello_provisioning_sync_repos: True
katello_provisioning_download_policy: on_demand
Expand Down
10 changes: 5 additions & 5 deletions roles/katello_provisioning/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

- name: 'Get CentOS 7 info'
ansible.builtin.set_fact:
katello_provisioning_centos7: "{{ katello_provisioning_centos7_json.stdout|from_json }}"
katello_provisioning_centos7: "{{ katello_provisioning_centos7_json.stdout | from_json }}"
when: katello_provisioning_centos7_json is success

- name: 'Create CentOS 7 os when not found'
Expand All @@ -219,7 +219,7 @@

- name: 'Get new CentOS 7 info'
ansible.builtin.set_fact:
katello_provisioning_centos7: "{{ katello_provisioning_centos7_json_new.stdout|from_json }}"
katello_provisioning_centos7: "{{ katello_provisioning_centos7_json_new.stdout | from_json }}"
when: "'not found' in katello_provisioning_centos7_json.stderr"

- name: 'Update partition table for CentOS 7'
Expand All @@ -235,7 +235,7 @@

- name: 'Set kickstart templates'
ansible.builtin.set_fact:
kickstart_templates: "{{ kickstart_templates_json.stdout|from_json }}"
kickstart_templates: "{{ kickstart_templates_json.stdout | from_json }}"

- name: 'Find katello kickstart templates'
ansible.builtin.shell: >
Expand All @@ -245,7 +245,7 @@

- name: 'Set kickstart templates'
ansible.builtin.set_fact:
katello_kickstart_templates: "{{ katello_kickstart_templates_json.stdout|from_json }}"
katello_kickstart_templates: "{{ katello_kickstart_templates_json.stdout | from_json }}"

- name: 'Associate kickstart templates to CentOS 7'
ansible.builtin.shell: >
Expand Down Expand Up @@ -273,7 +273,7 @@

- name: 'Set find centos kickstart repo'
ansible.builtin.set_fact:
katello_provisioning_repo_json: "{{ katello_provisioning_repo.stdout|from_json }}"
katello_provisioning_repo_json: "{{ katello_provisioning_repo.stdout | from_json }}"

- name: 'Find hostgroup Katello CentOS 7'
ansible.builtin.shell: >
Expand Down
2 changes: 1 addition & 1 deletion roles/pytest_project/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: 'Limit to markers'
ansible.builtin.set_fact:
pytest_project_command: "{{ pytest_project_command }} -m '{{ pytest_project_markers }}'"
when: pytest_project_markers|bool
when: pytest_project_markers | bool

- name: 'Run tests'
ansible.builtin.command: "{{ pytest_project_command }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/smoker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- name: 'Write variables.json'
ansible.builtin.copy:
dest: "{{ smoker_variables_path }}"
content: "{{ smoker_variables|to_json }}"
content: "{{ smoker_variables | to_json }}"

- name: 'Run Smoker via pytest_project'
ansible.builtin.include_role:
Expand Down

0 comments on commit 32250be

Please sign in to comment.