Skip to content

Commit

Permalink
address Ansible linter errors
Browse files Browse the repository at this point in the history
This addresses all errors reported by the Ansible linter.

Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits committed Feb 15, 2024
1 parent 05ba9c9 commit 8c7e297
Show file tree
Hide file tree
Showing 244 changed files with 5,424 additions and 4,876 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
with:
python-version: '3.10'
architecture: x64
- run: pip install -r <(grep ansible tests/requirements.txt) ansible-lint==6.16.0 netaddr
- run: pip install -r <(grep ansible tests/requirements.txt) ansible-lint netaddr
- run: ansible-galaxy install -r requirements.yml
- run: ansible-lint -x 106,204,205,208 -v --force-color ./roles/*/ ./infrastructure-playbooks/*.yml site-container.yml.sample site-container.yml.sample dashboard.yml
- run: ansible-lint -x 'yaml[line-length],role-name,run-once' -v --force-color ./roles/*/ ./infrastructure-playbooks/*.yml site-container.yml.sample site.yml.sample dashboard.yml
- run: ansible-playbook -i ./tests/functional/all_daemons/hosts site.yml.sample --syntax-check --list-tasks -vv
- run: ansible-playbook -i ./tests/functional/all_daemons/hosts site-container.yml.sample --syntax-check --list-tasks -vv
- run: ansible-playbook -i ./tests/functional/all_daemons/hosts dashboard.yml --syntax-check --list-tasks -vv
Expand Down
90 changes: 57 additions & 33 deletions dashboard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts:
- name: Deploy node_exporter
hosts:
- "{{ mon_group_name|default('mons') }}"
- "{{ osd_group_name|default('osds') }}"
- "{{ mds_group_name|default('mdss') }}"
Expand All @@ -12,113 +13,136 @@
gather_facts: false
become: true
pre_tasks:
- import_role:
- name: Import ceph-defaults role
ansible.builtin.import_role:
name: ceph-defaults
tags: ['ceph_update_config']

- name: set ceph node exporter install 'In Progress'
- name: Set ceph node exporter install 'In Progress'
run_once: true
set_stats:
ansible.builtin.set_stats:
data:
installer_phase_ceph_node_exporter:
status: "In Progress"
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

tasks:
- import_role:
- name: Import ceph-facts role
ansible.builtin.import_role:
name: ceph-facts
tags: ['ceph_update_config']
- import_role:

- name: Import ceph-container-engine
ansible.builtin.import_role:
name: ceph-container-engine
- import_role:

- name: Import ceph-container-common role
ansible.builtin.import_role:
name: ceph-container-common
tasks_from: registry
when:
- not containerized_deployment | bool
- ceph_docker_registry_auth | bool
- import_role:

- name: Import ceph-node-exporter role
ansible.builtin.import_role:
name: ceph-node-exporter

post_tasks:
- name: set ceph node exporter install 'Complete'
- name: Set ceph node exporter install 'Complete'
run_once: true
set_stats:
ansible.builtin.set_stats:
data:
installer_phase_ceph_node_exporter:
status: "Complete"
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

- hosts: "{{ monitoring_group_name | default('monitoring') }}"
- name: Deploy grafana and prometheus
hosts: "{{ monitoring_group_name | default('monitoring') }}"
gather_facts: false
become: true
pre_tasks:
- import_role:
- name: Import ceph-defaults role
ansible.builtin.import_role:
name: ceph-defaults
tags: ['ceph_update_config']

- name: set ceph grafana install 'In Progress'
- name: Set ceph grafana install 'In Progress'
run_once: true
set_stats:
ansible.builtin.set_stats:
data:
installer_phase_ceph_grafana:
status: "In Progress"
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

tasks:
- import_role:
name: ceph-facts
tags: ['ceph_update_config']
- import_role:
# - ansible.builtin.import_role:
# name: ceph-facts
# tags: ['ceph_update_config']

- name: Import ceph-facts role
ansible.builtin.import_role:
name: ceph-facts
tasks_from: grafana
tags: ['ceph_update_config']
- import_role:

- name: Import ceph-prometheus role
ansible.builtin.import_role:
name: ceph-prometheus
- import_role:

- name: Import ceph-grafana role
ansible.builtin.import_role:
name: ceph-grafana

post_tasks:
- name: set ceph grafana install 'Complete'
- name: Set ceph grafana install 'Complete'
run_once: true
set_stats:
ansible.builtin.set_stats:
data:
installer_phase_ceph_grafana:
status: "Complete"
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

# using groups[] here otherwise it can't fallback to the mon if there's no mgr group.
# adding an additional | default(omit) in case where no monitors are present (external ceph cluster)
- hosts: "{{ groups[mgr_group_name|default('mgrs')] | default(groups[mon_group_name|default('mons')]) | default(omit) }}"
- name: Deploy dashboard
hosts: "{{ groups['mgrs'] | default(groups['mons']) | default(omit) }}"
gather_facts: false
become: true
pre_tasks:
- import_role:
- name: Import ceph-defaults role
ansible.builtin.import_role:
name: ceph-defaults
tags: ['ceph_update_config']

- name: set ceph dashboard install 'In Progress'
- name: Set ceph dashboard install 'In Progress'
run_once: true
set_stats:
ansible.builtin.set_stats:
data:
installer_phase_ceph_dashboard:
status: "In Progress"
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

tasks:
- import_role:
name: ceph-facts
tags: ['ceph_update_config']
- import_role:
# - name: Import ceph-facts role
# ansible.builtin.import_role:
# name: ceph-facts
# tags: ['ceph_update_config']

- name: Import ceph-facts role
ansible.builtin.import_role:
name: ceph-facts
tasks_from: grafana
tags: ['ceph_update_config']
- import_role:

- name: Import ceph-dashboard role
ansible.builtin.import_role:
name: ceph-dashboard

post_tasks:
- name: set ceph dashboard install 'Complete'
- name: Set ceph dashboard install 'Complete'
run_once: true
set_stats:
ansible.builtin.set_stats:
data:
installer_phase_ceph_dashboard:
status: "Complete"
Expand Down
20 changes: 10 additions & 10 deletions group_vars/all.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dummy:
# If configure_firewall is true, then ansible will try to configure the
# appropriate firewalling rules so that Ceph daemons can communicate
# with each others.
#configure_firewall: True
#configure_firewall: true

# Open ports on corresponding nodes if firewall is installed on it
#ceph_mon_firewall_zone: public
Expand Down Expand Up @@ -120,7 +120,7 @@ dummy:
# This variable determines if ceph packages can be updated. If False, the
# package resources will use "state=present". If True, they will use
# "state=latest".
#upgrade_ceph_packages: False
#upgrade_ceph_packages: false

#ceph_use_distro_backports: false # DEBIAN ONLY
#ceph_directories_mode: "0755"
Expand Down Expand Up @@ -328,12 +328,12 @@ dummy:
#ip_version: ipv4

#mon_host_v1:
# enabled: True
# enabled: true
# suffix: ':6789'
#mon_host_v2:
# suffix: ':3300'

#enable_ceph_volume_debug: False
#enable_ceph_volume_debug: false

##########
# CEPHFS #
Expand Down Expand Up @@ -536,7 +536,7 @@ dummy:
#ceph_client_docker_image: "{{ ceph_docker_image }}"
#ceph_client_docker_image_tag: "{{ ceph_docker_image_tag }}"
#ceph_client_docker_registry: "{{ ceph_docker_registry }}"
#containerized_deployment: False
#containerized_deployment: false
#container_binary:
#timeout_command: "{{ 'timeout --foreground -s KILL ' ~ docker_pull_timeout if (docker_pull_timeout != '0') and (ceph_docker_dev_image is undefined or not ceph_docker_dev_image) else '' }}"

Expand All @@ -563,7 +563,7 @@ dummy:
# name: "images"
# rule_name: "my_replicated_rule"
# application: "rbd"
# pg_autoscale_mode: False
# pg_autoscale_mode: false
# pg_num: 16
# pgp_num: 16
# target_size_ratio: 0.2
Expand Down Expand Up @@ -613,7 +613,7 @@ dummy:
#############
# DASHBOARD #
#############
#dashboard_enabled: True
#dashboard_enabled: true
# Choose http or https
# For https, you should set dashboard.crt/key and grafana.crt/key
# If you define the dashboard_crt and dashboard_key variables, but leave them as '',
Expand All @@ -634,7 +634,7 @@ dummy:
#dashboard_grafana_api_no_ssl_verify: "{{ true if dashboard_protocol == 'https' and not grafana_crt and not grafana_key else false }}"
#dashboard_rgw_api_user_id: ceph-dashboard
#dashboard_rgw_api_admin_resource: ''
#dashboard_rgw_api_no_ssl_verify: False
#dashboard_rgw_api_no_ssl_verify: false
#dashboard_frontend_vip: ''
#dashboard_disabled_features: []
#prometheus_frontend_vip: ''
Expand Down Expand Up @@ -675,7 +675,7 @@ dummy:
#grafana_plugins:
# - vonage-status-panel
# - grafana-piechart-panel
#grafana_allow_embedding: True
#grafana_allow_embedding: true
#grafana_port: 3000
#grafana_network: "{{ public_network }}"
#grafana_conf_overrides: {}
Expand Down Expand Up @@ -773,7 +773,7 @@ dummy:

#client_connections: {}

#no_log_on_ceph_key_tasks: True
#no_log_on_ceph_key_tasks: true

###############
# DEPRECATION #
Expand Down
6 changes: 3 additions & 3 deletions group_vars/iscsigws.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ dummy:
# GENERAL #
###########
# Whether or not to generate secure certificate to iSCSI gateway nodes
#generate_crt: False
#generate_crt: false

#iscsi_conf_overrides: {}
#iscsi_pool_name: rbd
#iscsi_pool_size: 3
# iscsi_pool_size: 3

#copy_admin_key: True
#copy_admin_key: true

##################
# RBD-TARGET-API #
Expand Down
6 changes: 3 additions & 3 deletions group_vars/mdss.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dummy:
# ceph_mds_systemd_overrides will override the systemd settings
# for the ceph-mds services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mds_systemd_overrides:
# Service:
# PrivateDevices: False
# ceph_mds_systemd_overrides:
# Service:
# PrivateDevices: false

6 changes: 3 additions & 3 deletions group_vars/mgrs.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dummy:
# ceph_mgr_systemd_overrides will override the systemd settings
# for the ceph-mgr services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mgr_systemd_overrides:
# Service:
# PrivateDevices: False
# ceph_mgr_systemd_overrides:
# Service:
# PrivateDevices: false

6 changes: 3 additions & 3 deletions group_vars/mons.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dummy:
# ceph_mon_systemd_overrides will override the systemd settings
# for the ceph-mon services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mon_systemd_overrides:
# Service:
# PrivateDevices: False
# ceph_mon_systemd_overrides:
# Service:
# PrivateDevices: false

28 changes: 14 additions & 14 deletions group_vars/nfss.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ dummy:
#ceph_nfs_rgw_sectype: "sys,krb5,krb5i,krb5p"
# Note: keys are optional and can be generated, but not on containerized, where
# they must be configered.
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
# ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
# ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
#rgw_client_name: client.rgw.{{ ansible_facts['hostname'] }}

###################
Expand All @@ -106,19 +106,19 @@ dummy:
# https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/config_samples/ganesha.conf.example
#
# Example:
#CACHEINODE {
# #Entries_HWMark = 100000;
#}
# CACHEINODE {
# # Entries_HWMark = 100000;
# }
#
#ganesha_core_param_overrides:
#ganesha_ceph_export_overrides:
#ganesha_rgw_export_overrides:
#ganesha_rgw_section_overrides:
#ganesha_log_overrides:
#ganesha_conf_overrides: |
# CACHEINODE {
# #Entries_HWMark = 100000;
# }
# ganesha_core_param_overrides:
# ganesha_ceph_export_overrides:
# ganesha_rgw_export_overrides:
# ganesha_rgw_section_overrides:
# ganesha_log_overrides:
# ganesha_conf_overrides: |
# CACHEINODE {
# # Entries_HWMark = 100000;
# }

##########
# DOCKER #
Expand Down
Loading

0 comments on commit 8c7e297

Please sign in to comment.