Merge "Ansible lint: lines longer than 160 chars"

This commit is contained in:
Zuul 2020-04-17 09:29:00 +00:00 committed by Gerrit Code Review
commit 7a193d1f06
11 changed files with 37 additions and 16 deletions

View File

@ -56,4 +56,5 @@
delegate_to: localhost
register: result
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
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
changed_when: (keystone_bootstrap.stdout | from_json).changed
failed_when: (keystone_bootstrap.stdout | from_json).failed

View File

@ -53,7 +53,10 @@
- name: Creating monasca influxdb database
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
delegate_to: "{{ groups['influxdb'][0] }}"
when: monasca_influxdb_name not in monasca_influxdb_database.stdout_lines

View File

@ -54,7 +54,7 @@
module_name: uri
module_args:
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 }}'
password: '{{ monasca_grafana_admin_password }}'
return_content: true
@ -72,7 +72,7 @@
module_name: uri
module_args:
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 }}'
password: '{{ monasca_grafana_admin_password }}'
body: "{{ monasca_user_body | to_json }}"
@ -91,7 +91,7 @@
module_name: uri
module_args:
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 }}'
password: '{{ monasca_grafana_admin_password }}'
force_basic_auth: true
@ -114,6 +114,7 @@
run_once: True
changed_when: monasca_grafana_datasource_response.status == 200
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 }}"
when: item.value.enabled | bool

View File

@ -8,7 +8,9 @@
- name: Bootstrapping the mongodb replication set
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
failed_when: (bootstrap_mongodb_cluster.stdout|from_json).ok != 1
delegate_to: "{{ groups['mongodb'][0] }}"

View File

@ -30,7 +30,7 @@
- name: Update cell
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'] }}"
become: true
kolla_docker:

View File

@ -97,7 +97,8 @@
- name: Extract nova key from file
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
run_once: True
when:
@ -106,7 +107,8 @@
- name: Extract cinder key from file
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
run_once: True
when:

View File

@ -2,7 +2,7 @@
- name: Create cell0 mappings
vars:
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
kolla_docker:
action: "start_container"

View File

@ -38,7 +38,9 @@
service_name: "ovsdpdk-db"
service: "{{ ovsdpdk_services[service_name] }}"
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
changed_when: status.stdout.find('changed') != -1
when:
@ -70,7 +72,9 @@
service_name: "ovsdpdk-db"
service: "{{ ovsdpdk_services[service_name] }}"
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
changed_when: status.stdout.find('changed') != -1
when:

View File

@ -1,7 +1,10 @@
---
- name: Creating Panko MongoDB database
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
run_once: true
changed_when: mongodb_panko_database.stdout.find('already') == -1

View File

@ -121,7 +121,9 @@
- name: Fail if ring files don't exist
run_once: True
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 }}'
when:
- not item.stat.exists