Ansible lint: lines longer than 160 chars

Change-Id: I500cc8800c412bc0e95edb15babad5c1189e6ee4
This commit is contained in:
Michal Nasiadka 2020-01-14 14:50:49 +01:00
parent a1793a2f97
commit d403690b88
11 changed files with 37 additions and 16 deletions

View File

@ -50,4 +50,5 @@
delegate_to: localhost delegate_to: localhost
register: result register: result
changed_when: false changed_when: false
failed_when: result.stdout | regex_replace('(60|120|180|240|300|360|600|720|900|1200|1800|3600|7200|10800|14400|21600|28800|43200|86400|604800)', '') is search(".+") failed_when:
- result.stdout | regex_replace('(60|120|180|240|300|360|600|720|900|1200|1800|3600|7200|10800|14400|21600|28800|43200|86400|604800)', '') is search(".+")

View File

@ -1,7 +1,10 @@
--- ---
- name: Creating admin project, user, role, service, and endpoint - name: Creating admin project, user, role, service, and endpoint
become: true become: true
command: docker exec "{{ keystone_services['keystone']['container_name'] }}" kolla_keystone_bootstrap {{ openstack_auth.username }} {{ openstack_auth.password }} {{ openstack_auth.project_name }} admin {{ keystone_admin_url }} {{ keystone_internal_url }} {{ keystone_public_url }} {{ item }} command: >
docker exec keystone kolla_keystone_bootstrap
{{ openstack_auth.username }} {{ openstack_auth.password }} {{ openstack_auth.project_name }}
admin {{ keystone_admin_url }} {{ keystone_internal_url }} {{ keystone_public_url }} {{ item }}
register: keystone_bootstrap register: keystone_bootstrap
changed_when: (keystone_bootstrap.stdout | from_json).changed changed_when: (keystone_bootstrap.stdout | from_json).changed
failed_when: (keystone_bootstrap.stdout | from_json).failed failed_when: (keystone_bootstrap.stdout | from_json).failed

View File

@ -53,7 +53,10 @@
- name: Creating monasca influxdb database - name: Creating monasca influxdb database
become: true become: true
command: "docker exec influxdb influx -host {{ monasca_influxdb_address }} -port {{ monasca_influxdb_http_port }} -execute 'CREATE DATABASE {{ monasca_influxdb_name }} WITH DURATION {{ monasca_influxdb_retention_policy.duration }} REPLICATION {{ monasca_influxdb_retention_policy.replication_count }} NAME {{ monasca_influxdb_retention_policy.name }}'" command: >
docker exec influxdb influx -host {{ monasca_influxdb_address }} -port {{ monasca_influxdb_http_port }} -execute
'CREATE DATABASE {{ monasca_influxdb_name }} WITH DURATION {{ monasca_influxdb_retention_policy.duration }}
REPLICATION {{ monasca_influxdb_retention_policy.replication_count }} NAME {{ monasca_influxdb_retention_policy.name }}'
run_once: True run_once: True
delegate_to: "{{ groups['influxdb'][0] }}" delegate_to: "{{ groups['influxdb'][0] }}"
when: monasca_influxdb_name not in monasca_influxdb_database.stdout_lines when: monasca_influxdb_name not in monasca_influxdb_database.stdout_lines

View File

@ -54,7 +54,7 @@
module_name: uri module_name: uri
module_args: module_args:
method: GET method: GET
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/orgs/name/{{ monasca_grafana_control_plane_org }}" url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/orgs/name/{{ monasca_grafana_control_plane_org }}" # noqa 204
user: '{{ monasca_grafana_admin_username }}' user: '{{ monasca_grafana_admin_username }}'
password: '{{ monasca_grafana_admin_password }}' password: '{{ monasca_grafana_admin_password }}'
return_content: true return_content: true
@ -72,7 +72,7 @@
module_name: uri module_name: uri
module_args: module_args:
method: POST method: POST
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/orgs/{{ monasca_grafana_conf_org.json.id }}/users" url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/orgs/{{ monasca_grafana_conf_org.json.id }}/users" # noqa 204
user: '{{ monasca_grafana_admin_username }}' user: '{{ monasca_grafana_admin_username }}'
password: '{{ monasca_grafana_admin_password }}' password: '{{ monasca_grafana_admin_password }}'
body: "{{ monasca_user_body | to_json }}" body: "{{ monasca_user_body | to_json }}"
@ -91,7 +91,7 @@
module_name: uri module_name: uri
module_args: module_args:
method: POST method: POST
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/user/using/{{ monasca_grafana_conf_org.json.id }}" url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/user/using/{{ monasca_grafana_conf_org.json.id }}" # noqa 204
user: '{{ monasca_grafana_admin_username }}' user: '{{ monasca_grafana_admin_username }}'
password: '{{ monasca_grafana_admin_password }}' password: '{{ monasca_grafana_admin_password }}'
force_basic_auth: true force_basic_auth: true
@ -114,6 +114,7 @@
run_once: True run_once: True
changed_when: monasca_grafana_datasource_response.status == 200 changed_when: monasca_grafana_datasource_response.status == 200
failed_when: monasca_grafana_datasource_response.status not in [200, 409] or failed_when: monasca_grafana_datasource_response.status not in [200, 409] or
monasca_grafana_datasource_response.status == 409 and ("Data source with same name already exists" not in monasca_grafana_datasource_response.json.message|default("")) (monasca_grafana_datasource_response.status == 409 and
("Data source with same name already exists" not in monasca_grafana_datasource_response.json.message|default(""))
with_dict: "{{ monasca_grafana_data_sources }}" with_dict: "{{ monasca_grafana_data_sources }}"
when: item.value.enabled | bool when: item.value.enabled | bool

View File

@ -8,7 +8,9 @@
- name: Bootstrapping the mongodb replication set - name: Bootstrapping the mongodb replication set
become: true become: true
command: "docker exec -t mongodb mongo --host {{ api_interface_address }} --port {{ mongodb_port }} --quiet --eval '{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'" command: >
docker exec -t mongodb mongo --host {{ api_interface_address }} --port {{ mongodb_port }} --quiet --eval
'{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'
register: bootstrap_mongodb_cluster register: bootstrap_mongodb_cluster
failed_when: (bootstrap_mongodb_cluster.stdout|from_json).ok != 1 failed_when: (bootstrap_mongodb_cluster.stdout|from_json).ok != 1
delegate_to: "{{ groups['mongodb'][0] }}" delegate_to: "{{ groups['mongodb'][0] }}"

View File

@ -28,7 +28,7 @@
- name: Update cell - name: Update cell
vars: vars:
nova_cell_database_url: "mysql+pymysql://{{ nova_cell_database_user }}:{{ nova_cell_database_password }}@{{ nova_cell_database_address | put_address_in_context('url') }}:{{ nova_cell_database_port }}/{{ nova_cell_database_name }}" nova_cell_database_url: "mysql+pymysql://{{ nova_cell_database_user }}:{{ nova_cell_database_password }}@{{ nova_cell_database_address | put_address_in_context('url') }}:{{ nova_cell_database_port }}/{{ nova_cell_database_name }}" # noqa 204
nova_conductor: "{{ nova_cell_services['nova-conductor'] }}" nova_conductor: "{{ nova_cell_services['nova-conductor'] }}"
become: true become: true
kolla_docker: kolla_docker:

View File

@ -97,7 +97,8 @@
- name: Extract nova key from file - name: Extract nova key from file
set_fact: set_fact:
nova_cephx_raw_key: "{{ lookup('file', nova_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}" nova_cephx_raw_key:
"{{ lookup('file', nova_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}"
changed_when: false changed_when: false
run_once: True run_once: True
when: when:
@ -106,7 +107,8 @@
- name: Extract cinder key from file - name: Extract cinder key from file
set_fact: set_fact:
cinder_cephx_raw_key: "{{ lookup('file', cinder_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}" cinder_cephx_raw_key:
"{{ lookup('file', cinder_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}"
changed_when: false changed_when: false
run_once: True run_once: True
when: when:

View File

@ -2,7 +2,7 @@
- name: Create cell0 mappings - name: Create cell0 mappings
vars: vars:
nova_api: "{{ nova_services['nova-api'] }}" nova_api: "{{ nova_services['nova-api'] }}"
nova_cell0_connection: "mysql+pymysql://{{ nova_cell0_database_user }}:{{ nova_cell0_database_password }}@{{ nova_cell0_database_address }}/{{ nova_cell0_database_name }}" nova_cell0_connection: "mysql+pymysql://{{ nova_cell0_database_user }}:{{ nova_cell0_database_password }}@{{ nova_cell0_database_address }}/{{ nova_cell0_database_name }}" # noqa 204
become: true become: true
kolla_docker: kolla_docker:
action: "start_container" action: "start_container"

View File

@ -38,7 +38,9 @@
service_name: "ovsdpdk-db" service_name: "ovsdpdk-db"
service: "{{ ovsdpdk_services[service_name] }}" service: "{{ ovsdpdk_services[service_name] }}"
become: true become: true
command: "docker exec {{ service.container_name }} /bin/sh -c 'CONFIG_FILE={{ container_config_directory }}/ovs-dpdkctl.conf {{ container_config_directory }}/ovs-dpdkctl.sh init'" command: >
docker exec {{ service.container_name }} /bin/sh -c
'CONFIG_FILE={{ container_config_directory }}/ovs-dpdkctl.conf {{ container_config_directory }}/ovs-dpdkctl.sh init'
register: status register: status
changed_when: status.stdout.find('changed') != -1 changed_when: status.stdout.find('changed') != -1
when: when:
@ -70,7 +72,9 @@
service_name: "ovsdpdk-db" service_name: "ovsdpdk-db"
service: "{{ ovsdpdk_services[service_name] }}" service: "{{ ovsdpdk_services[service_name] }}"
become: true become: true
command: "docker exec {{ service.container_name }} /bin/sh -c 'CONFIG_FILE={{ container_config_directory }}/ovs-dpdkctl.conf {{ container_config_directory }}/ovs-dpdkctl.sh init'" command: >
docker exec {{ service.container_name }} /bin/sh -c
'CONFIG_FILE={{ container_config_directory }}/ovs-dpdkctl.conf {{ container_config_directory }}/ovs-dpdkctl.sh init'
register: status register: status
changed_when: status.stdout.find('changed') != -1 changed_when: status.stdout.find('changed') != -1
when: when:

View File

@ -1,7 +1,10 @@
--- ---
- name: Creating Panko MongoDB database - name: Creating Panko MongoDB database
become: true become: true
command: docker exec -t mongodb mongo --host {{ mongodb_replication_set_name }}/{{ panko_database_mongodb_address }} --eval 'db = db.getSiblingDB("{{ panko_database_name }}"); db.createUser({user':' "{{ panko_database_user }}", pwd':' "{{ panko_database_password }}", roles':' [ "readWrite", "dbAdmin" ]})' command: >
docker exec -t mongodb mongo --host {{ mongodb_replication_set_name }}/{{ panko_database_mongodb_address }} --eval
'db = db.getSiblingDB("{{ panko_database_name }}");
db.createUser({user':' "{{ panko_database_user }}", pwd':' "{{ panko_database_password }}", roles':' [ "readWrite", "dbAdmin" ]})'
register: mongodb_panko_database register: mongodb_panko_database
run_once: true run_once: true
changed_when: mongodb_panko_database.stdout.find('already') == -1 changed_when: mongodb_panko_database.stdout.find('already') == -1

View File

@ -115,7 +115,9 @@
- name: Fail if ring files don't exist - name: Fail if ring files don't exist
run_once: True run_once: True
fail: fail:
msg: "Swift ring files do not exist. Ensure .builder and .gz are available for each of account/container/object under {{ node_custom_config }}/swift before deploying Swift." msg: >-
Swift ring files do not exist.
Ensure .builder and .gz are available for each of account/container/object under {{ node_custom_config }}/swift before deploying Swift.
with_items: '{{ swift_ring_files.results }}' with_items: '{{ swift_ring_files.results }}'
when: when:
- not item.stat.exists - not item.stat.exists