Skip to content

Commit abe8e80

Browse files
committed
Fix all ansible-lint issues
1 parent 8576553 commit abe8e80

File tree

7 files changed

+105
-105
lines changed

7 files changed

+105
-105
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Pull request
3-
'on':
3+
"on":
44
pull_request:
55
jobs:
66
lint:

ansible/generate-magnum-capi-templates.yml

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,59 @@
44
vars:
55
root_dir: ../
66
tasks:
7-
8-
- name: Check that required variables are defined
9-
assert:
10-
that:
11-
- magnum_default_master_flavor_name is defined
12-
- magnum_default_worker_flavor_name is defined
13-
- magnum_external_net_name is defined
14-
- magnum_loadbalancer_provider is defined
15-
16-
- name: Fetch capi-helm-charts release information
17-
ansible.builtin.uri:
18-
url: https://api.github.com/repos/azimuth-cloud/capi-helm-charts/releases/latest
19-
register: capi_helm_chart_release_data
20-
21-
- name: Fetch dependencies.json for capi-helm-charts release
22-
ansible.builtin.uri:
23-
url: https://raw.githubusercontent.com/azimuth-cloud/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json
24-
register: dependencies_response
25-
26-
- name: Ensure wget packages is installed
27-
become: true
28-
package:
29-
name: wget
30-
state: present
31-
32-
- name: Fetch manifest.json for capi-helm-charts images
7+
- name: Check that required variables are defined
8+
ansible.builtin.assert:
9+
that:
10+
- magnum_default_master_flavor_name is defined
11+
- magnum_default_worker_flavor_name is defined
12+
- magnum_external_net_name is defined
13+
- magnum_loadbalancer_provider is defined
14+
15+
- name: Fetch capi-helm-charts release information
16+
ansible.builtin.uri:
17+
url: https://api.github.com/repos/azimuth-cloud/capi-helm-charts/releases/latest
18+
register: capi_helm_chart_release_data
19+
20+
- name: Fetch dependencies.json for capi-helm-charts release
21+
ansible.builtin.uri:
22+
url: https://raw.githubusercontent.com/azimuth-cloud/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json
23+
register: dependencies_response
24+
25+
- name: Ensure wget packages is installed
26+
become: true
27+
ansible.builtin.package:
28+
name: wget
29+
state: present
30+
31+
- name: Fetch manifest.json for capi-helm-charts images # noqa command-instead-of-module
3332
# ansible.builtin.uri:
3433
# url: https://raw.githubusercontent.com/azimuth-cloud/azimuth-images/{{ dependencies_response.json['azimuth-images'] }}/manifest.json
3534
# Above URL returns 404 even though similar URL for capi-helm-charts repo works fine
3635
# Not sure why but fall back to wget + JSON parsing for now.
37-
shell: "wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json"
38-
register: manifest_response
39-
changed_when: false
40-
41-
- name: Parse JSON response
42-
set_fact:
43-
new_template_data: "{{ manifest_response.stdout | from_json | dict2items | selectattr('key', 'match', 'kubernetes*') | list }}"
44-
45-
- name: Ensure output dir exists
46-
ansible.builtin.file:
47-
path: "{{ [root_dir, 'generated-magnum-snippets', now(utc=true,fmt='%Y-%m-%d-T%H-%M-%S')] | path_join }}"
48-
state: directory
49-
mode: '0755'
50-
register: output_dir
51-
52-
- name: Write new image config to file
53-
template:
54-
src: "magnum-capi-images.j2"
55-
dest: "{{ output_dir.path }}/images.yml"
56-
57-
- name: Write new cluster template config to file
58-
template:
59-
src: "magnum-capi-templates.j2"
60-
dest: "{{ output_dir.path }}/templates.yml"
36+
ansible.builtin.command: >-
37+
wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json
38+
register: manifest_response
39+
changed_when: false
40+
41+
- name: Parse JSON response
42+
ansible.builtin.set_fact:
43+
new_template_data: "{{ manifest_response.stdout | from_json | dict2items | selectattr('key', 'match', 'kubernetes*') | list }}"
44+
45+
- name: Ensure output dir exists
46+
ansible.builtin.file:
47+
path: "{{ [root_dir, 'generated-magnum-snippets', now(utc=true, fmt='%Y-%m-%d-T%H-%M-%S')] | path_join }}"
48+
state: directory
49+
mode: "0755"
50+
register: output_dir
51+
52+
- name: Write new image config to file
53+
ansible.builtin.template:
54+
src: "magnum-capi-images.j2"
55+
dest: "{{ output_dir.path }}/images.yml"
56+
mode: "0644"
57+
58+
- name: Write new cluster template config to file
59+
ansible.builtin.template:
60+
src: "magnum-capi-templates.j2"
61+
dest: "{{ output_dir.path }}/templates.yml"
62+
mode: "0644"

ansible/openstack.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
# Top level playbook that includes all others.
3-
- import_playbook: openstack-project.yml
4-
- import_playbook: openstack-networks.yml
5-
- import_playbook: openstack-flavors.yml
6-
- import_playbook: openstack-images.yml
7-
- import_playbook: openstack-host-aggregates.yml
8-
- import_playbook: openstack-volume-types.yml
9-
- import_playbook: openstack-container-clusters.yml
10-
- import_playbook: openstack-ratings.yml
3+
4+
- import_playbook: openstack-project.yml # noqa name[play]
5+
- import_playbook: openstack-networks.yml # noqa name[play]
6+
- import_playbook: openstack-flavors.yml # noqa name[play]
7+
- import_playbook: openstack-images.yml # noqa name[play]
8+
- import_playbook: openstack-host-aggregates.yml # noqa name[play]
9+
- import_playbook: openstack-volume-types.yml # noqa name[play]
10+
- import_playbook: openstack-container-clusters.yml # noqa name[play]
11+
- import_playbook: openstack-ratings.yml # noqa name[play]

etc/openstack-config/openstack-config.yml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,64 @@
44

55
# List of OpenStack domains. Format is as required by the stackhpc.os-projects
66
# role.
7-
#openstack_domains:
7+
# openstack_domains:
88

99
# List of OpenStack projects. Format is as required by the stackhpc.os-projects
1010
# role.
11-
#openstack_projects:
11+
# openstack_projects:
1212

1313
###############################################################################
1414
# Configuration of networks, subnets and routers.
1515

1616
# List of networks in the openstack system. Format is as required by the
1717
# stackhpc.os-networks role.
18-
#openstack_networks:
18+
# openstack_networks:
1919

2020
# List of routers in the openstack project. Format is as required by the
2121
# stackhpc.os-networks role.
22-
#openstack_routers:
22+
# openstack_routers:
2323

2424
# List of security groups in the openstack project.
2525
# Format is as required by the stackhpc.os-networks role.
26-
#openstack_security_groups:
26+
# openstack_security_groups:
2727

2828
# List of RBAC definitions in the openstack projct. Format is as required by the
2929
# stackhpc.os-networks role.
30-
#openstack_networks_rbac:
30+
# openstack_networks_rbac:
3131

3232
###############################################################################
3333
# Configuration of nova flavors.
3434

3535
# List of nova flavors in the openstack project. Format is as required by the
3636
# stackhpc.os-flavors role.
37-
#openstack_flavors:
37+
# openstack_flavors:
3838

3939
###############################################################################
4040
# Configuration of nova host aggregates.
4141

4242
# List of nova host aggregates. Format is as required by the
4343
# stackhpc.os_host_aggregates role.
44-
#openstack_host_aggregates:
44+
# openstack_host_aggregates:
4545

4646
###############################################################################
4747
# Configuration of Glance software images.
4848

4949
# List of Glance images. Format is as required by the stackhpc.os-images role.
50-
#openstack_images:
50+
# openstack_images:
5151

5252
# List of Diskimage Builder (DIB) elements paths to include in image builds.
53-
#openstack_image_elements:
53+
# openstack_image_elements:
5454

5555
# List of Diskimage Builder (DIB) elements Git repositories to use in image
5656
# builds.
57-
#openstack_image_git_elements:
57+
# openstack_image_git_elements:
5858

5959
###############################################################################
6060
# Configuration of Magnum container clusters.
6161

6262
# List of magnum cluster templates. Format is as required by the
6363
# stackhpc.os-container-clusters role.
64-
#openstack_container_clusters_templates:
64+
# openstack_container_clusters_templates:
6565

6666
###############################################################################
6767
# Configuration variables for generating new Magnum cluster template config.
@@ -100,35 +100,33 @@
100100
# Configuration variables for a CloudKitty ratings service deployment.
101101

102102
# # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY
103-
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE
103+
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE
104104
# # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG.
105105
# # # # # # # MORE INFO CAN BE FOUND IN THE README.md
106106
# # ### # ##### 'stackhpc-kayobe-config' DOCS.
107-
108-
109-
# A list where each item is a dictionary mapping the associated fields,
107+
# A list where each item is a dictionary mapping the associated fields,
110108
# with the 'mappings' field also being a list of dictionaries. Example
111109
# of the mappings and their fields can be found below, however for more
112110
# information please refer to the stackhpc.openstack.os_ratings role docs.
113111
#
114-
#openstack_ratings_hashmap_field_mappings:
115-
# - service: SERVICE_NAME
116-
# name: FIELD_NAME
117-
# mappings:
118-
# - value: MAPPING_VALUE
119-
# cost: MAPPING_COST
120-
# type: MAPPING_TYPE
121-
# group: MAPPING_GROUP <---THIS IS OPTIONAL---
112+
# openstack_ratings_hashmap_field_mappings:
113+
# - service: SERVICE_NAME
114+
# name: FIELD_NAME
115+
# mappings:
116+
# - value: MAPPING_VALUE
117+
# cost: MAPPING_COST
118+
# type: MAPPING_TYPE
119+
# group: MAPPING_GROUP <---THIS IS OPTIONAL---
122120

123121
# Much like the field mappings above, the service mappings are a list of
124122
# dictionaries, however these are not associated with a field.
125123
#
126-
#openstack_ratings_hashmap_service_mappings:
127-
# - service: SERVICE_NAME
128-
# cost: MAPPING_COST
129-
# type: MAPPING_TYPE
130-
# group: MAPPING_GROUP <---THIS IS OPTIONAL---
124+
# openstack_ratings_hashmap_service_mappings:
125+
# - service: SERVICE_NAME
126+
# cost: MAPPING_COST
127+
# type: MAPPING_TYPE
128+
# group: MAPPING_GROUP <---THIS IS OPTIONAL---
131129

132130
###############################################################################
133131
# Dummy variable to allow Ansible to accept this file.
134-
workaround_ansible_issue_8743: yes
132+
workaround_ansible_issue_8743: true

examples/container-clusters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ openstack_container_clusters_templates:
99

1010
# Kubernetes magnum cluster template.
1111
openstack_container_clusters_template_k8s_fedora_coreos:
12-
labels: "heat_container_agent_tag=ussuri-stable-1,kube_tag=v1.18.9,cloud_provider_tag=v1.18.2,monitoring_enabled=true,auto_scaling_enabled=true,auto_healing_enabled=true,auto_healing_controller=magnum-auto-healer,magnum_auto_healer_tag=latest,master_lb_floating_ip_enabled=true,cinder_csi_enabled=true,ingress_controller=octavia"
12+
labels: "heat_container_agent_tag=ussuri-stable-1,kube_tag=v1.18.9,cloud_provider_tag=v1.18.2,monitoring_enabled=true,auto_scaling_enabled=true,auto_healing_enabled=true,auto_healing_controller=magnum-auto-healer,magnum_auto_healer_tag=latest,master_lb_floating_ip_enabled=true,cinder_csi_enabled=true,ingress_controller=octavia" # noqa yaml[line-length]
1313
external-network: "external"
1414
master-flavor: "m1.medium"
1515
flavor: "m1.medium"

examples/images.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ openstack_image_centos_stream8:
3434
- "vm"
3535
- "grub2"
3636
- "stable-interface-names"
37-
is_public: True
37+
is_public: true
3838
env:
3939
YUM: dnf
4040
DIB_RELEASE: "8-stream"
@@ -55,7 +55,7 @@ openstack_image_cirros_0_6_0:
5555
type: qcow2
5656
image_url: "https://github.com/cirros-dev/cirros/releases/download/0.6.0/cirros-0.6.0-x86_64-disk.img"
5757
checksum: "md5:f4027b89e99e238184e13089a3155b74"
58-
is_public: True
58+
is_public: true
5959
properties:
6060
os_type: "linux"
6161
os_distro: "cirros"
@@ -78,7 +78,7 @@ openstack_image_rocky8:
7878
- "grub2"
7979
- "stable-interface-names"
8080
- "openssh-server"
81-
is_public: True
81+
is_public: true
8282
packages:
8383
- "bash-completion"
8484
- "vim-enhanced"
@@ -101,7 +101,7 @@ openstack_image_rocky8:
101101
openstack_image_ubuntu_focal:
102102
name: "Ubuntu-20.04"
103103
type: raw
104-
is_public: True
104+
is_public: true
105105
elements:
106106
# Required for UEFI mode:
107107
- "block-device-efi"

examples/ratings.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@
33
# Configuration of CloudKitty for openstack.
44

55
# Example configuration for registering CloudKitty fields.
6-
# Included is mapping for various different compute flavors &
7-
# a service mapping based on the stored image size in Glance.
6+
# Included is mapping for various different compute flavors &
7+
# a service mapping based on the stored image size in Glance.
88

99
openstack_ratings_hashmap_field_mappings:
1010
- service: instance
1111
name: flavor_id
1212
mappings:
13-
- value: '1' #tiny compute flavour with an OpenStack flavor ID of 1
13+
- value: "1" # tiny compute flavour with an OpenStack flavor ID of 1
1414
cost: 1.0
1515
group: instance_uptime_flavor_id
1616
type: flat
17-
- value: '2' #small compute flavour with an OpenStack flavor ID of 2
17+
- value: "2" # small compute flavour with an OpenStack flavor ID of 2
1818
cost: 2.0
1919
group: instance_uptime_flavor_id
2020
type: flat
21-
- value: '3' #medium compute flavour with an OpenStack flavor ID of 3
21+
- value: "3" # medium compute flavour with an OpenStack flavor ID of 3
2222
cost: 3.0
2323
group: instance_uptime_flavor_id
2424
type: flat
25-
- value: '4' #large compute flavour with an OpenStack flavor ID of 4
25+
- value: "4" # large compute flavour with an OpenStack flavor ID of 4
2626
cost: 4.0
2727
group: instance_uptime_flavor_id
2828
type: flat
29-
- value: '5' #xlarge compute flavour with an OpenStack flavor ID of 5
29+
- value: "5" # xlarge compute flavour with an OpenStack flavor ID of 5
3030
cost: 5.0
3131
group: instance_uptime_flavor_id
3232
type: flat
33-
- value: '6' #tiny 2 compute flavour with an OpenStack flavor ID of 6
33+
- value: "6" # tiny 2 compute flavour with an OpenStack flavor ID of 6
3434
cost: 2.0
3535
group: instance_uptime_flavor_id
3636
type: flat
@@ -42,8 +42,7 @@ openstack_ratings_hashmap_service_mappings:
4242
type: flat
4343

4444
# # ### ####### ##### THIS CONFIGURATION FILE ONLY WORKS IF
45-
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE
45+
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE
4646
# # # # # # ### CONFIGURED CORRECTLY. MORE INFO CAN
47-
# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config'
47+
# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config'
4848
# # ### # ##### DOCS.
49-

0 commit comments

Comments
 (0)