diff options
Diffstat (limited to 'ansible')
45 files changed, 273 insertions, 91 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 3073537e3..91b1b50c7 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -108,7 +108,7 @@ storage_interface: "{{ network_interface }}" cluster_interface: "{{ network_interface }}" tunnel_interface: "{{ network_interface }}" bifrost_network_interface: "{{ network_interface }}" - +tunnel_interface_address: "{{ hostvars[inventory_hostname]['ansible_' + tunnel_interface]['ipv4']['address'] }}" # Valid options are [ openvswitch, linuxbridge, sfc ] neutron_plugin_agent: "openvswitch" @@ -256,6 +256,7 @@ enable_ceph_rgw: "no" enable_cinder: "no" enable_cinder_backend_iscsi: "no" enable_cinder_backend_lvm: "no" +enable_cinder_backend_nfs: "no" enable_cloudkitty: "no" enable_congress: "no" enable_etcd: "no" @@ -341,6 +342,7 @@ keystone_admin_url: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keyston keystone_internal_url: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v3" keystone_public_url: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ keystone_public_port }}/v3" +# Valid options are [ uuid, fernet ] keystone_token_provider: "uuid" fernet_token_expiry: 86400 diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index 69f8ab190..fbe77903d 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -33,7 +33,11 @@ control control [telegraf:children] +compute +control monitoring +network +storage [elasticsearch:children] control @@ -243,10 +247,10 @@ manila manila [manila-share:children] -storage +network [manila-data:children] -storage +manila # Swift [swift-proxy-server:children] diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index f63aeafea..1cd317904 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -51,7 +51,11 @@ monitoring control [telegraf:children] +compute +control monitoring +network +storage [elasticsearch:children] control @@ -258,10 +262,10 @@ manila manila [manila-share:children] -storage +network [manila-data:children] -storage +manila # Swift [swift-proxy-server:children] diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py index 0f2bd44a2..28f752a2e 100644 --- a/ansible/library/kolla_docker.py +++ b/ansible/library/kolla_docker.py @@ -651,7 +651,7 @@ class DockerWorker(object): def generate_module(): argument_spec = dict( common_options=dict(required=False, type='dict', default=dict()), - action=dict(requried=True, type='str', choices=['compare_image', + action=dict(required=True, type='str', choices=['compare_image', 'create_volume', 'get_container_env', 'get_container_state', diff --git a/ansible/roles/aodh/tasks/config.yml b/ansible/roles/aodh/tasks/config.yml index 90179933a..971477aec 100644 --- a/ansible/roles/aodh/tasks/config.yml +++ b/ansible/roles/aodh/tasks/config.yml @@ -53,6 +53,11 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/aodh/policy.json" - dest: "{{ node_config_directory }}/aodh/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "aodh-api" + - "aodh-evaluator" + - "aodh-listener" + - "aodh-notifier" when: aodh_policy.stat.exists diff --git a/ansible/roles/barbican/tasks/config.yml b/ansible/roles/barbican/tasks/config.yml index fab9b3dda..0b71c1ce5 100644 --- a/ansible/roles/barbican/tasks/config.yml +++ b/ansible/roles/barbican/tasks/config.yml @@ -59,6 +59,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/barbican/policy.json" - dest: "{{ node_config_directory }}/barbican/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "barbican-api" + - "barbican-keystone-listener" + - "barbican-worker" when: barbican_policy.stat.exists diff --git a/ansible/roles/baremetal/tasks/install.yml b/ansible/roles/baremetal/tasks/install.yml index f6ee106b1..7538ee100 100644 --- a/ansible/roles/baremetal/tasks/install.yml +++ b/ansible/roles/baremetal/tasks/install.yml @@ -4,6 +4,28 @@ become: True when: ansible_os_family == 'Debian' +- name: Set firewall default policy + ufw: state=disabled policy=allow + when: ansible_os_family == 'Debian' + +- name: Check if firewalld is installed + command: rpm -q firewalld + register: firewalld_check + failed_when: firewalld_check.rc > 1 + when: ansible_os_family == 'RedHat' + +- name: Disable firewalld + become: True + service: + name: "{{ item }}" + enabled: false + state: stopped + with_items: + - firewalld + when: + - ansible_os_family == 'RedHat' + - firewalld_check.rc == 0 + - name: Install apt packages package: name={{item}} state=present become: True diff --git a/ansible/roles/ceilometer/defaults/main.yml b/ansible/roles/ceilometer/defaults/main.yml index e3d015df6..60205fe3e 100644 --- a/ansible/roles/ceilometer/defaults/main.yml +++ b/ansible/roles/ceilometer/defaults/main.yml @@ -7,10 +7,10 @@ project_name: "ceilometer" #################### ceilometer_database_name: "ceilometer" ceilometer_database_user: "ceilometer" -ceilometer_database_port: "{{ mondodb_port if ceilometer_database_type == 'mongodb' else database_port }}" +ceilometer_database_port: "{{ mongodb_port if ceilometer_database_type == 'mongodb' else database_port }}" ceilometer_database_mongodb_address: "{% for host in groups['mongodb'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ ceilometer_database_port }}{% if not loop.last %},{% endif %}{% endfor %}" -ceilometer_database_mysql_address: "{{ kolla_internal_fqdn }}:{{ ceilometer_database_port }}" +ceilometer_database_mysql_address: "{{ kolla_internal_fqdn }}" #################### diff --git a/ansible/roles/ceilometer/tasks/config.yml b/ansible/roles/ceilometer/tasks/config.yml index 63c77f38d..e4c6cdf7b 100644 --- a/ansible/roles/ceilometer/tasks/config.yml +++ b/ansible/roles/ceilometer/tasks/config.yml @@ -67,6 +67,12 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/ceilometer/policy.json" - dest: "{{ node_config_directory }}/ceilometer/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "ceilometer-notification" + - "ceilometer-collector" + - "ceilometer-api" + - "ceilometer-central" + - "ceilometer-compute" when: ceilometer_policy.stat.exists diff --git a/ansible/roles/ceilometer/templates/ceilometer.conf.j2 b/ansible/roles/ceilometer/templates/ceilometer.conf.j2 index 1a4515830..91f520541 100644 --- a/ansible/roles/ceilometer/templates/ceilometer.conf.j2 +++ b/ansible/roles/ceilometer/templates/ceilometer.conf.j2 @@ -8,6 +8,9 @@ transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }} {% if ceilometer_database_type == 'gnocchi' %} meter_dispatchers = gnocchi event_dispatchers = gnocchi +{% else %} +meter_dispatchers = database +event_dispatchers = database {% endif %} [api] @@ -21,8 +24,8 @@ host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['addr event_connection = mongodb://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mongodb_address }}/{{ ceilometer_database_name }} metering_connection = mongodb://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mongodb_address }}/{{ ceilometer_database_name }} {% elif ceilometer_database_type == "mysql" %} -event_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}/{{ ceilometer_database_name }} -metering_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}/{{ ceilometer_database_name }} +event_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}:{{ ceilometer_database_port }}/{{ ceilometer_database_name }} +metering_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}:{{ ceilometer_database_port }}/{{ ceilometer_database_name }} {% endif %} [keystone_authtoken] diff --git a/ansible/roles/ceph/tasks/bootstrap_mons.yml b/ansible/roles/ceph/tasks/bootstrap_mons.yml index e145b0c3c..a5ec39d4c 100644 --- a/ansible/roles/ceph/tasks/bootstrap_mons.yml +++ b/ansible/roles/ceph/tasks/bootstrap_mons.yml @@ -2,13 +2,13 @@ - name: Cleaning up temp file on localhost local_action: file path=/tmp/kolla_ceph_cluster state=absent changed_when: False - always_run: True + check_mode: no run_once: True - name: Creating temp file on localhost local_action: copy content=None dest=/tmp/kolla_ceph_cluster mode=0644 changed_when: False - always_run: True + check_mode: no run_once: True - name: Creating ceph_mon_config volume @@ -21,7 +21,7 @@ - name: Writing hostname of host with existing cluster files to temp file local_action: copy content="{{ inventory_hostname }}" dest=/tmp/kolla_ceph_cluster mode=0644 changed_when: False - always_run: True + check_mode: no when: not ceph_mon_config_volume.changed - name: Registering host from temp file @@ -31,7 +31,7 @@ - name: Cleaning up temp file on localhost local_action: file path=/tmp/kolla_ceph_cluster state=absent changed_when: False - always_run: True + check_mode: no run_once: True - include: generate_cluster.yml diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index ad948e6a4..757022f02 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -74,5 +74,8 @@ cinder_backends: - name: "lvm-1" driver: "lvm" enabled: "{{ enable_cinder_backend_lvm | bool }}" + - name: "nfs-1" + driver: "nfs" + enabled: "{{ enable_cinder_backend_nfs | bool }}" cinder_enabled_backends: "{{ cinder_backends|selectattr('enabled', 'equalto', true)|list }}" diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index 800401615..49f187946 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -46,6 +46,23 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/cinder/policy.json" - dest: "{{ node_config_directory }}/cinder/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "cinder-api" + - "cinder-backup" + - "cinder-scheduler" + - "cinder-volume" when: cinder_policy.stat.exists + +- name: Copying over nfs_shares files for cinder_volume + template: + src: "{{ item }}" + dest: "{{ node_config_directory }}/cinder-volume/nfs_shares" + with_first_found: + - files: + - "{{ node_custom_config }}/nfs_shares.j2" + - "{{ node_custom_config }}/cinder/nfs_shares.j2" + - "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2" + - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2" + skip: "{{ not enable_cinder_backend_nfs | bool }}" diff --git a/ansible/roles/cinder/templates/cinder-volume.json.j2 b/ansible/roles/cinder/templates/cinder-volume.json.j2 index db3891119..5dc729b14 100644 --- a/ansible/roles/cinder/templates/cinder-volume.json.j2 +++ b/ansible/roles/cinder/templates/cinder-volume.json.j2 @@ -6,19 +6,28 @@ "dest": "/etc/cinder/cinder.conf", "owner": "cinder", "perm": "0600" - }{% if cinder_backend_ceph | bool %}, + }, { "source": "{{ container_config_directory }}/ceph.*", "dest": "/etc/ceph/", "owner": "cinder", - "perm": "0700" + "perm": "0700", + "optional": {{ (not cinder_backend_ceph | bool) | string | lower }} }, { "source": "{{ container_config_directory }}/ceph.conf", "dest": "/etc/ceph/ceph.conf", "owner": "cinder", - "perm": "0600" - }{% endif %} + "perm": "0600", + "optional": {{ (not cinder_backend_ceph | bool) | string | lower }} + }, + { + "source": "{{ container_config_directory }}/nfs_shares", + "dest": "/etc/cinder/nfs_shares", + "owner": "cinder", + "perm": "0600", + "optional": {{ (not enable_cinder_backend_nfs | bool) | string | lower }} + } ], "permissions": [ { diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index a34ee75fd..16f07b976 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -99,5 +99,12 @@ rbd_secret_uuid = {{ rbd_secret_uuid }} report_discard_supported = True {% endif %} +{% if enable_cinder_backend_nfs | bool %} +[nfs-1] +volume_driver = cinder.volume.drivers.nfs.NfsDriver +volume_backend_name = nfs-1 +nfs_shares_config = /etc/cinder/nfs_shares +{% endif %} + [privsep_entrypoint] helper_command=sudo cinder-rootwrap /etc/cinder/rootwrap.conf privsep-helper --config-file /etc/cinder/cinder.conf diff --git a/ansible/roles/cloudkitty/tasks/config.yml b/ansible/roles/cloudkitty/tasks/config.yml index ea3d13cbb..d614334ca 100644 --- a/ansible/roles/cloudkitty/tasks/config.yml +++ b/ansible/roles/cloudkitty/tasks/config.yml @@ -40,6 +40,9 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/cloudkitty/policy.json" - dest: "{{ node_config_directory }}/cloudkitty/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "cloudkitty-api" + - "cloudkitty-processor" when: cloudkitty_policy.stat.exists diff --git a/ansible/roles/congress/tasks/config.yml b/ansible/roles/congress/tasks/config.yml index 0e9a63135..f44772659 100644 --- a/ansible/roles/congress/tasks/config.yml +++ b/ansible/roles/congress/tasks/config.yml @@ -43,6 +43,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/congress/policy.json" - dest: "{{ node_config_directory }}/congress/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "congress-api" + - "congress-policy-engine" + - "congress-datasource" when: congress_policy.stat.exists diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index 743815ba8..d88993353 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -37,6 +37,8 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/glance/policy.json" - dest: "{{ node_config_directory }}/glance/policy.json" + dest: "{{ node_config_directory }}/{{ item.service }}/policy.json" when: - glance_policy.stat.exists + - inventory_hostname in groups[item.group] + - glance_policy.stat.exists + with_items: "{{ glance_service_groups }}" diff --git a/ansible/roles/gnocchi/tasks/config.yml b/ansible/roles/gnocchi/tasks/config.yml index b6fa16dd0..5e74dca26 100644 --- a/ansible/roles/gnocchi/tasks/config.yml +++ b/ansible/roles/gnocchi/tasks/config.yml @@ -58,6 +58,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/gnocchi/policy.json" - dest: "{{ node_config_directory }}/gnocchi/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "gnocchi-api" + - "gnocchi-statsd" + - "gnocchi-metricd" when: gnocchi_policy.stat.exists diff --git a/ansible/roles/heat/tasks/config.yml b/ansible/roles/heat/tasks/config.yml index dca462a50..125062f90 100644 --- a/ansible/roles/heat/tasks/config.yml +++ b/ansible/roles/heat/tasks/config.yml @@ -50,6 +50,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/heat/policy.json" - dest: "{{ node_config_directory }}/heat/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "heat-api" + - "heat-api-cfn" + - "heat-engine" when: heat_policy.stat.exists diff --git a/ansible/roles/horizon/defaults/main.yml b/ansible/roles/horizon/defaults/main.yml index 169bfd68b..2658e2fd3 100644 --- a/ansible/roles/horizon/defaults/main.yml +++ b/ansible/roles/horizon/defaults/main.yml @@ -21,6 +21,8 @@ horizon_image_full: "{{ horizon_image }}:{{ horizon_tag }}" #################### openstack_horizon_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" +horizon_logging_debug: "{{ openstack_logging_debug }}" + #################### # Horizon diff --git a/ansible/roles/horizon/tasks/start.yml b/ansible/roles/horizon/tasks/start.yml index e178b92a2..746cae568 100644 --- a/ansible/roles/horizon/tasks/start.yml +++ b/ansible/roles/horizon/tasks/start.yml @@ -5,6 +5,8 @@ common_options: "{{ docker_common_options }}" image: "{{ horizon_image_full }}" name: "horizon" + environment: + ENABLE_NEUTRON_LBAAS: "{{ 'yes' if enable_neutron_lbaas | bool else 'no' }}" volumes: - "{{ node_config_directory }}/horizon/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" diff --git a/ansible/roles/horizon/templates/local_settings.j2 b/ansible/roles/horizon/templates/local_settings.j2 index 891b19441..733e2ab42 100644 --- a/ansible/roles/horizon/templates/local_settings.j2 +++ b/ansible/roles/horizon/templates/local_settings.j2 @@ -7,7 +7,7 @@ from django.utils.translation import ugettext_lazy as _ from openstack_dashboard import exceptions from openstack_dashboard.settings import HORIZON_CONFIG -DEBUG = False +DEBUG = {{ horizon_logging_debug }} TEMPLATE_DEBUG = DEBUG COMPRESS_OFFLINE = True diff --git a/ansible/roles/ironic/tasks/config.yml b/ansible/roles/ironic/tasks/config.yml index 797b49482..d082ecf08 100644 --- a/ansible/roles/ironic/tasks/config.yml +++ b/ansible/roles/ironic/tasks/config.yml @@ -45,6 +45,11 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/ironic/policy.json" - dest: "{{ node_config_directory }}/ironic/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "ironic-api" + - "ironic-conductor" + - "ironic-inspector" + - "ironic-pxe" when: ironic_policy.stat.exists diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml index e531d6869..695154571 100644 --- a/ansible/roles/keystone/tasks/config.yml +++ b/ansible/roles/keystone/tasks/config.yml @@ -62,7 +62,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/keystone/policy.json" - dest: "{{ node_config_directory }}/keystone/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "keystone" + - "keystone-fernet" when: keystone_policy.stat.exists diff --git a/ansible/roles/keystone/templates/keystone.conf.j2 b/ansible/roles/keystone/templates/keystone.conf.j2 index 6f73e98a0..ff33a241f 100644 --- a/ansible/roles/keystone/templates/keystone.conf.j2 +++ b/ansible/roles/keystone/templates/keystone.conf.j2 @@ -20,8 +20,10 @@ domain_specific_drivers_enabled = true domain_config_dir = /etc/keystone/domains {% endif %} -{% if keystone_token_provider == 'fernet' %} [token] +{% if keystone_token_provider == 'uuid' %} +provider = uuid +{% elif keystone_token_provider == 'fernet' %} provider = {{ keystone_token_provider }} expiration = {{ fernet_token_expiry }} diff --git a/ansible/roles/kibana/tasks/start.yml b/ansible/roles/kibana/tasks/start.yml index f58174804..239e892c2 100644 --- a/ansible/roles/kibana/tasks/start.yml +++ b/ansible/roles/kibana/tasks/start.yml @@ -8,3 +8,4 @@ volumes: - "{{ node_config_directory }}/kibana/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" + - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/magnum/tasks/config.yml b/ansible/roles/magnum/tasks/config.yml index 5baa4a6ca..2fa679bc6 100644 --- a/ansible/roles/magnum/tasks/config.yml +++ b/ansible/roles/magnum/tasks/config.yml @@ -40,6 +40,9 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/magnum/policy.json" - dest: "{{ node_config_directory }}/magnum/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "magnum-api" + - "magnum-conductor" when: magnum_policy.stat.exists diff --git a/ansible/roles/magnum/templates/magnum.conf.j2 b/ansible/roles/magnum/templates/magnum.conf.j2 index 7deb2b1e4..e567d3239 100644 --- a/ansible/roles/magnum/templates/magnum.conf.j2 +++ b/ansible/roles/magnum/templates/magnum.conf.j2 @@ -29,8 +29,8 @@ region_name = {{ openstack_region_name }} [keystone_auth] auth_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v3 -user_domain_id = default -project_domain_id = default +user_domain_name = Default +project_domain_name = Default project_name = service password = {{ magnum_keystone_password }} username = {{ magnum_keystone_user }} @@ -41,8 +41,8 @@ auth_version = v3 auth_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v3 auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }} auth_type = password -project_domain_id = default -user_domain_id = default +project_domain_name = Default +user_domain_name = Default project_name = service username = {{ magnum_keystone_user }} password = {{ magnum_keystone_password }} diff --git a/ansible/roles/manila/tasks/config.yml b/ansible/roles/manila/tasks/config.yml index 5e03b4d47..c975cdd75 100644 --- a/ansible/roles/manila/tasks/config.yml +++ b/ansible/roles/manila/tasks/config.yml @@ -63,6 +63,11 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/manila/policy.json" - dest: "{{ node_config_directory }}/manila/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "manila-api" + - "manila-data" + - "manila-scheduler" + - "manila-share" when: manila_policy.stat.exists diff --git a/ansible/roles/mariadb/tasks/lookup_cluster.yml b/ansible/roles/mariadb/tasks/lookup_cluster.yml index fefc9d325..efca14ee0 100644 --- a/ansible/roles/mariadb/tasks/lookup_cluster.yml +++ b/ansible/roles/mariadb/tasks/lookup_cluster.yml @@ -2,13 +2,13 @@ - name: Cleaning up temp file on localhost local_action: file path=/tmp/kolla_mariadb_cluster state=absent changed_when: False - always_run: True + check_mode: no run_once: True - name: Creating temp file on localhost local_action: copy content=None dest=/tmp/kolla_mariadb_cluster mode=0644 changed_when: False - always_run: True + check_mode: no run_once: True - name: Creating mariadb volume @@ -21,7 +21,7 @@ - name: Writing hostname of host with existing cluster files to temp file local_action: copy content={{ ansible_hostname }} dest=/tmp/kolla_mariadb_cluster mode=0644 changed_when: False - always_run: True + check_mode: no when: not mariadb_volume | changed - name: Registering host from temp file @@ -31,5 +31,5 @@ - name: Cleaning up temp file on localhost local_action: file path=/tmp/kolla_mariadb_cluster state=absent changed_when: False - always_run: True + check_mode: no run_once: True diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml index f45b907cb..bf62a85f4 100644 --- a/ansible/roles/mariadb/tasks/recover_cluster.yml +++ b/ansible/roles/mariadb/tasks/recover_cluster.yml @@ -17,12 +17,12 @@ - name: Cleaning up temp file on mariadb hosts file: path=/tmp/kolla_mariadb_grastate.dat state=absent changed_when: false - always_run: true + check_mode: no - name: Cleaning up temp file on localhost local_action: file path=/tmp/kolla_mariadb_recover_inventory_name state=absent changed_when: false - always_run: true + check_mode: no run_once: true - block: @@ -60,12 +60,12 @@ - name: Cleaning up temp file on mariadb hosts file: path=/tmp/kolla_mariadb_grastate.dat state=absent changed_when: false - always_run: true + check_mode: no - name: Cleaning up temp file on localhost local_action: file path=/tmp/kolla_mariadb_recover_inventory_name state=absent changed_when: false - always_run: true + check_mode: no run_once: true - name: Starting first MariaDB container diff --git a/ansible/roles/mistral/tasks/config.yml b/ansible/roles/mistral/tasks/config.yml index 723074eac..62f12d18a 100644 --- a/ansible/roles/mistral/tasks/config.yml +++ b/ansible/roles/mistral/tasks/config.yml @@ -43,6 +43,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/mistral/policy.json" - dest: "{{ node_config_directory }}/mistral/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "mistral-api" + - "mistral-engine" + - "mistral-executor" when: mistral_policy.stat.exists diff --git a/ansible/roles/murano/tasks/config.yml b/ansible/roles/murano/tasks/config.yml index 779c277d5..725703f72 100644 --- a/ansible/roles/murano/tasks/config.yml +++ b/ansible/roles/murano/tasks/config.yml @@ -40,6 +40,9 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/murano/policy.json" - dest: "{{ node_config_directory }}/murano/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "murano-api" + - "murano-engine" when: murano_policy.stat.exists diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml index 82921cd96..bc18d0380 100644 --- a/ansible/roles/neutron/tasks/config.yml +++ b/ansible/roles/neutron/tasks/config.yml @@ -191,6 +191,15 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/neutron/policy.json" - dest: "{{ node_config_directory }}/neutron/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "neutron-dhcp-agent" + - "neutron-l3-agent" + - "neutron-linuxbridge-agent" + - "neutron-metadata-agent" + - "neutron-openvswitch-agent" + - "neutron-server" + - "neutron-lbaas-agent" + - "neutron-vpnaas-agent" when: neutron_policy.stat.exists diff --git a/ansible/roles/neutron/templates/ml2_conf.ini.j2 b/ansible/roles/neutron/templates/ml2_conf.ini.j2 index f304d023e..b689440e0 100644 --- a/ansible/roles/neutron/templates/ml2_conf.ini.j2 +++ b/ansible/roles/neutron/templates/ml2_conf.ini.j2 @@ -69,4 +69,4 @@ physical_interface_mappings = physnet1:{{ neutron_external_interface }} [vxlan] l2_population = true {% endif %} -local_ip = {{ api_interface_address }} +local_ip = {{ tunnel_interface_address }} diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index b3c7ada0b..472431e1b 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -15,7 +15,7 @@ api_paste_config = /usr/share/neutron/api-paste.ini endpoint_type = internalURL api_workers = {{ openstack_service_workers }} -metadata_works = {{ openstack_service_workers }} +metadata_workers = {{ openstack_service_workers }} # NOTE(SamYaple): We must specify this value here rather than the metadata conf # because it is used by the l3 and dhcp agents. The reason the path has 'kolla' diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml index b8750b930..e7c7a06e3 100644 --- a/ansible/roles/nova/tasks/config.yml +++ b/ansible/roles/nova/tasks/config.yml @@ -91,6 +91,15 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/nova/policy.json" - dest: "{{ node_config_directory }}/nova/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "nova-api" + - "nova-compute" + - "nova-compute-ironic" + - "nova-conductor" + - "nova-consoleauth" + - "nova-novncproxy" + - "nova-scheduler" + - "nova-spicehtml5proxy" when: nova_policy.stat.exists diff --git a/ansible/roles/nova/tasks/start_compute.yml b/ansible/roles/nova/tasks/start_compute.yml index 1ba3c47c8..d40e7a007 100644 --- a/ansible/roles/nova/tasks/start_compute.yml +++ b/ansible/roles/nova/tasks/start_compute.yml @@ -17,6 +17,7 @@ - "kolla_logs:/var/log/kolla/" - "libvirtd:/var/lib/libvirt" - "nova_compute:/var/lib/nova/" + - "/var/lib/nova/mnt:/var/lib/nova/mnt:shared" - "nova_libvirt_qemu:/etc/libvirt/qemu" register: start_nova_libvirt_container # NOTE(Jeffrey4l): retry 5 to remove nova_libvirt container because when @@ -37,6 +38,7 @@ - "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}" - "libvirtd:/var/lib/libvirt" - "nova_compute:/var/lib/nova/" + - "/var/lib/nova/mnt:/var/lib/nova/mnt:shared" - name: Starting nova-compute container kolla_docker: @@ -94,6 +96,7 @@ - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla" - "nova_compute:/var/lib/nova" + - "/var/lib/nova/mnt:/var/lib/nova/mnt:shared" - "heka_socket:/var/lib/kolla/heka/" # TODO(jeffrey4l): how to handle the nova-compute-fake and # nova-compute-ironic diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index ae7a48a52..faf7a7614 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -1,4 +1,38 @@ --- +- name: Checking the api_interface is present + fail: "msg='Please check the api_interface property - interface {{ api_interface }} not found'" + when: api_interface not in ansible_interfaces + +- name: Checking the api_interface is active + fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not active'" + when: hostvars[inventory_hostname]['ansible_' + api_interface]['active'] != True + +- name: Checking the api_interface configuration + fail: "msg='Please check the api_interface settings - interface {{ api_interface }} configuration missing'" + when: hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4'] is not defined + +- name: Checking the api_interface ip address configuration + fail: "msg='Please check the api_interface settings - interface {{ api_interface }} ip address problem'" + when: hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] is not defined + +- name: Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node + command: ping -c 3 {{ item }} + register: ping_output + changed_when: false + with_items: + - "{{ kolla_internal_vip_address }}" + - "{{ kolla_external_vip_address }}" + failed_when: ping_output.rc != 1 + when: enable_haproxy | bool + +- name: Checking if kolla_internal_vip_address is in the same network as api_interface on all nodes + command: ip -4 -o addr show dev {{ api_interface }} + register: ip_addr_output + changed_when: false + failed_when: "'169.254.' not in kolla_internal_vip_address and \ + kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none" + when: enable_haproxy | bool + - name: Checking free port for Aodh API wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" @@ -911,37 +945,3 @@ when: - inventory_hostname in groups['haproxy'] - enable_searchlight | bool - -- name: Checking the network_interface is present - fail: "msg='Please check the network_interface property - interface {{ network_interface }} not found'" - when: network_interface not in ansible_interfaces - -- name: Checking the network_interface is active - fail: "msg='Please check the network_interface settings - interface {{ network_interface }} is not active'" - when: hostvars[inventory_hostname]['ansible_' + network_interface]['active'] != True - -- name: Checking the network_interface configuration - fail: "msg='Please check the network_interface settings - interface {{ network_interface }} configuration missing'" - when: hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4'] is not defined - -- name: Checking the network_interface ip address configuration - fail: "msg='Please check the network_interface settings - interface {{ network_interface }} ip address problem'" - when: hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] is not defined - -- name: Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node - command: ping -c 3 {{ item }} - register: ping_output - changed_when: false - with_items: - - "{{ kolla_internal_vip_address }}" - - "{{ kolla_external_vip_address }}" - failed_when: ping_output.rc != 1 - when: enable_haproxy | bool - -- name: Checking if kolla_internal_vip_address is in the same network as network_interface on all nodes - command: ip -4 -o addr show dev {{ network_interface }} - register: ip_addr_output - changed_when: false - failed_when: "'169.254.' not in kolla_internal_vip_address and \ - kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none" - when: enable_haproxy | bool diff --git a/ansible/roles/sahara/tasks/config.yml b/ansible/roles/sahara/tasks/config.yml index a83df50ca..59cda5314 100644 --- a/ansible/roles/sahara/tasks/config.yml +++ b/ansible/roles/sahara/tasks/config.yml @@ -40,6 +40,9 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/sahara/policy.json" - dest: "{{ node_config_directory }}/sahara/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "sahara-api" + - "sahara-engine" when: sahara_policy.stat.exists diff --git a/ansible/roles/searchlight/tasks/config.yml b/ansible/roles/searchlight/tasks/config.yml index 4237b6bdd..1bec9a7ac 100644 --- a/ansible/roles/searchlight/tasks/config.yml +++ b/ansible/roles/searchlight/tasks/config.yml @@ -38,6 +38,9 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/searchlight/policy.json" - dest: "{{ node_config_directory }}/searchlight/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "searchlight-api" + - "searchlight-listener" when: searchlight_policy.stat.exists diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml index 17ff0f83a..54773529b 100644 --- a/ansible/roles/senlin/tasks/config.yml +++ b/ansible/roles/senlin/tasks/config.yml @@ -40,6 +40,9 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/senlin/policy.json" - dest: "{{ node_config_directory }}/senlin/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "senlin-api" + - "senlin-engine" when: senlin_policy.stat.exists diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml index 10c26de5a..3b81038ee 100644 --- a/ansible/roles/swift/tasks/config.yml +++ b/ansible/roles/swift/tasks/config.yml @@ -160,6 +160,21 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/swift/policy.json" - dest: "{{ node_config_directory }}/swift/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "swift-account-auditor" + - "swift-account-reaper" + - "swift-account-replicator" + - "swift-account-server" + - "swift-container-auditor" + - "swift-container-replicator" + - "swift-container-server" + - "swift-container-updater" + - "swift-object-auditor" + - "swift-object-expirer" + - "swift-object-replicator" + - "swift-object-server" + - "swift-object-updater" + - "swift-proxy-server" when: swift_policy.stat.exists diff --git a/ansible/roles/watcher/tasks/config.yml b/ansible/roles/watcher/tasks/config.yml index 9d4ae9f7a..9f32f9398 100644 --- a/ansible/roles/watcher/tasks/config.yml +++ b/ansible/roles/watcher/tasks/config.yml @@ -43,6 +43,10 @@ - name: Copying over existing policy.json template: src: "{{ node_custom_config }}/watcher/policy.json" - dest: "{{ node_config_directory }}/watcher/policy.json" + dest: "{{ node_config_directory }}/{{ item }}/policy.json" + with_items: + - "watcher-api" + - "watcher-engine" + - "watcher-applier" when: watcher_policy.stat.exists |
