diff options
| author | Steven Dake <stdake@cisco.com> | 2016-11-15 19:01:25 -0700 |
|---|---|---|
| committer | Steven Dake <stdake@cisco.com> | 2016-11-15 21:34:17 -0700 |
| commit | 3fcef82946f7053affcfb0b1b3ef4292beb9fa95 (patch) | |
| tree | 0b9083d2cbf7d6c8d372de6b016419d6a719d424 /ansible/roles/nova/tasks | |
| parent | 0963c2255a9718419c1cf8deaff350ea6ddc8472 (diff) | |
| download | kolla-3fcef82946f7053affcfb0b1b3ef4292beb9fa95.tar.gz kolla-3fcef82946f7053affcfb0b1b3ef4292beb9fa95.zip | |
Remove Ansible from Kolla
Change-Id: I5396e4b9927d3e65b6aa4185238a43a4765a996b
Diffstat (limited to 'ansible/roles/nova/tasks')
| -rw-r--r-- | ansible/roles/nova/tasks/bootstrap.yml | 79 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/bootstrap_service.yml | 20 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/ceph.yml | 61 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/config-nova-fake.yml | 28 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/config.yml | 105 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/deploy.yml | 44 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/external-ceph.yml | 49 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/main.yml | 2 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/precheck.yml | 1 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/pull.yml | 78 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/reconfigure.yml | 318 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/register.yml | 43 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/reload.yml | 21 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/start.yml | 6 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/start_compute.yml | 103 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/start_conductors.yml | 12 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/start_controllers.yml | 66 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/upgrade.yml | 38 |
18 files changed, 0 insertions, 1074 deletions
diff --git a/ansible/roles/nova/tasks/bootstrap.yml b/ansible/roles/nova/tasks/bootstrap.yml deleted file mode 100644 index dd2222591..000000000 --- a/ansible/roles/nova/tasks/bootstrap.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -- name: Creating Nova database - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m mysql_db - -a "login_host='{{ database_address }}' - login_port='{{ database_port }}' - login_user='{{ database_user }}' - login_password='{{ database_password }}' - name='{{ nova_database_name }}'" - register: database - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and - (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - failed_when: database.stdout.split()[2] != 'SUCCESS' - run_once: True - delegate_to: "{{ groups['nova-api'][0] }}" - -- name: Reading json from variable - set_fact: - database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - -- name: Creating Nova-api database - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m mysql_db - -a "login_host='{{ database_address }}' - login_port='{{ database_port }}' - login_user='{{ database_user }}' - login_password='{{ database_password }}' - name='{{ nova_api_database_name }}'" - register: database_api - changed_when: "{{ database_api.stdout.find('localhost | SUCCESS => ') != -1 and - (database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - failed_when: database_api.stdout.split()[2] != 'SUCCESS' - run_once: True - delegate_to: "{{ groups['nova-api'][0] }}" - -- name: Reading json from variable - set_fact: - database_api_created: "{{ (database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - -- name: Creating Nova database user and setting permissions - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m mysql_user - -a "login_host='{{ database_address }}' - login_port='{{ database_port }}' - login_user='{{ database_user }}' - login_password='{{ database_password }}' - name='{{ nova_database_name }}' - password='{{ nova_database_password }}' - host='%' - priv='{{ nova_database_name }}.*:ALL' - append_privs='yes'" - register: database_user_create - changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and - (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' - run_once: True - delegate_to: "{{ groups['nova-api'][0] }}" - -- name: Creating Nova-api database user and setting permissions - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m mysql_user - -a "login_host='{{ database_address }}' - login_port='{{ database_port }}' - login_user='{{ database_user }}' - login_password='{{ database_password }}' - name='{{ nova_api_database_name }}' - password='{{ nova_api_database_password }}' - host='%' - priv='{{ nova_api_database_name }}.*:ALL' - append_privs='yes'" - register: database_api_user_create - changed_when: "{{ database_api_user_create.stdout.find('localhost | SUCCESS => ') != -1 and - (database_api_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - failed_when: database_api_user_create.stdout.split()[2] != 'SUCCESS' - run_once: True - delegate_to: "{{ groups['nova-api'][0] }}" - -- include: bootstrap_service.yml - when: database_created diff --git a/ansible/roles/nova/tasks/bootstrap_service.yml b/ansible/roles/nova/tasks/bootstrap_service.yml deleted file mode 100644 index 33ce56728..000000000 --- a/ansible/roles/nova/tasks/bootstrap_service.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Running Nova bootstrap container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - detach: False - environment: - KOLLA_BOOTSTRAP: - KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" - image: "{{ nova_api_image_full }}" - labels: - BOOTSTRAP: - name: "bootstrap_nova" - restart_policy: "never" - volumes: - - "{{ node_config_directory }}/nova-api/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - run_once: True - delegate_to: "{{ groups['nova-api'][0] }}" diff --git a/ansible/roles/nova/tasks/ceph.yml b/ansible/roles/nova/tasks/ceph.yml deleted file mode 100644 index 36a2dfc2a..000000000 --- a/ansible/roles/nova/tasks/ceph.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - with_items: - - "nova-compute" - - "nova-libvirt/secrets" - when: inventory_hostname in groups['compute'] - -- name: Copying over config(s) - template: - src: roles/ceph/templates/ceph.conf.j2 - dest: "{{ node_config_directory }}/{{ item }}/ceph.conf" - with_items: - - "nova-compute" - - "nova-libvirt" - when: inventory_hostname in groups['compute'] - -- include: ../../ceph_pools.yml - vars: - pool_name: "{{ nova_pool_name }}" - pool_type: "{{ nova_pool_type }}" - cache_mode: "{{ nova_cache_mode }}" - -# TODO(SamYaple): Improve changed_when tests -- name: Pulling cephx keyring for nova - command: docker exec ceph_mon ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ ceph_cinder_pool_name }}, allow rwx pool={{ ceph_cinder_pool_name }}-cache, allow rwx pool={{ ceph_nova_pool_name }}, allow rwx pool={{ ceph_nova_pool_name }}-cache, allow rwx pool={{ ceph_glance_pool_name }}, allow rwx pool={{ ceph_glance_pool_name }}-cache' - register: cephx_key - delegate_to: "{{ groups['ceph-mon'][0] }}" - changed_when: False - run_once: True - -# TODO(SamYaple): Improve failed_when and changed_when tests -- name: Pulling cephx keyring for libvirt - command: docker exec ceph_mon ceph auth get-key client.nova - register: cephx_raw_key - delegate_to: "{{ groups['ceph-mon'][0] }}" - changed_when: False - run_once: True - -- name: Pushing cephx keyring for nova - copy: - content: "{{ cephx_key.stdout }}\n\r" - dest: "{{ node_config_directory }}/nova-compute/ceph.client.nova.keyring" - mode: "0600" - when: inventory_hostname in groups['compute'] - -- name: Pushing secrets xml for libvirt - template: - src: "secret.xml.j2" - dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ rbd_secret_uuid }}.xml" - mode: "0600" - when: inventory_hostname in groups['compute'] - -- name: Pushing secrets key for libvirt - copy: - content: "{{ cephx_raw_key.stdout }}" - dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ rbd_secret_uuid }}.base64" - mode: "0600" - when: inventory_hostname in groups['compute'] diff --git a/ansible/roles/nova/tasks/config-nova-fake.yml b/ansible/roles/nova/tasks/config-nova-fake.yml deleted file mode 100644 index 2bd74e115..000000000 --- a/ansible/roles/nova/tasks/config-nova-fake.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Ensuring config directories exist - file: - path: "{{ node_config_directory }}/nova-compute-fake-{{ item }}" - state: "directory" - recurse: yes - with_sequence: start=1 end={{ num_nova_fake_per_node }} - -- name: Copying over config.json files for services - template: - src: "nova-compute.json.j2" - dest: "{{ node_config_directory }}/nova-compute-fake-{{ item }}/config.json" - with_sequence: start=1 end={{ num_nova_fake_per_node }} - -- name: Copying over nova.conf - merge_configs: - vars: - service_name: "{{ item }}" - sources: - - "{{ role_path }}/templates/nova.conf.j2" - - "{{ node_config_directory }}/config/global.conf" - - "{{ node_config_directory }}/config/database.conf" - - "{{ node_config_directory }}/config/messaging.conf" - - "{{ node_config_directory }}/config/nova.conf" - - "{{ node_config_directory }}/config/nova/{{ item }}.conf" - - "{{ node_config_directory }}/config/nova/{{ inventory_hostname }}/nova.conf" - dest: "{{ node_config_directory }}/nova-compute-fake-{{ item }}/nova.conf" - with_sequence: start=1 end={{ num_nova_fake_per_node }} diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml deleted file mode 100644 index e7c7a06e3..000000000 --- a/ansible/roles/nova/tasks/config.yml +++ /dev/null @@ -1,105 +0,0 @@ ---- -- name: Setting sysctl values - sysctl: name={{ item.name }} value={{ item.value }} sysctl_set=yes - with_items: - - { name: "net.bridge.bridge-nf-call-iptables", value: 1} - - { name: "net.bridge.bridge-nf-call-ip6tables", value: 1} - - { name: "net.ipv4.conf.all.rp_filter", value: 0} - - { name: "net.ipv4.conf.default.rp_filter", value: 0} - when: - - set_sysctl | bool - - inventory_hostname in groups['compute'] - -- name: Ensuring config directories exist - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - recurse: yes - with_items: - - "nova-api" - - "nova-compute" - - "nova-compute-ironic" - - "nova-conductor" - - "nova-consoleauth" - - "nova-libvirt" - - "nova-novncproxy" - - "nova-scheduler" - - "nova-spicehtml5proxy" - - "nova-ssh" - -- name: Copying over config.json files for services - template: - src: "{{ item }}.json.j2" - dest: "{{ node_config_directory }}/{{ item }}/config.json" - with_items: - - "nova-api" - - "nova-compute" - - "nova-compute-ironic" - - "nova-conductor" - - "nova-consoleauth" - - "nova-libvirt" - - "nova-novncproxy" - - "nova-scheduler" - - "nova-spicehtml5proxy" - - "nova-ssh" - -- name: Copying over nova.conf - merge_configs: - vars: - service_name: "{{ item }}" - sources: - - "{{ role_path }}/templates/nova.conf.j2" - - "{{ node_custom_config }}/global.conf" - - "{{ node_custom_config }}/database.conf" - - "{{ node_custom_config }}/messaging.conf" - - "{{ node_custom_config }}/nova.conf" - - "{{ node_custom_config }}/nova/{{ item }}.conf" - - "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf" - dest: "{{ node_config_directory }}/{{ item }}/nova.conf" - with_items: - - "nova-api" - - "nova-compute" - - "nova-compute-ironic" - - "nova-conductor" - - "nova-consoleauth" - - "nova-novncproxy" - - "nova-scheduler" - - "nova-spicehtml5proxy" - -- name: Copying over libvirt configuration - template: - src: "{{ item.src }}" - dest: "{{ node_config_directory }}/nova-libvirt/{{ item.dest }}" - with_items: - - { src: "qemu.conf.j2", dest: "qemu.conf" } - - { src: "libvirtd.conf.j2", dest: "libvirtd.conf" } - -- name: Copying files for nova-ssh - template: - src: "{{ item.src }}" - dest: "{{ node_config_directory }}/nova-ssh/{{ item.dest }}" - with_items: - - { src: "sshd_config.j2", dest: "sshd_config" } - - { src: "id_rsa", dest: "id_rsa" } - - { src: "id_rsa.pub", dest: "id_rsa.pub" } - - { src: "ssh_config.j2", dest: "ssh_config" } - -- name: Check if policies shall be overwritten - local_action: stat path="{{ node_custom_config }}/nova/policy.json" - register: nova_policy - -- name: Copying over existing policy.json - template: - src: "{{ node_custom_config }}/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/deploy.yml b/ansible/roles/nova/tasks/deploy.yml deleted file mode 100644 index 21efc2b2e..000000000 --- a/ansible/roles/nova/tasks/deploy.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- include: ceph.yml - when: - - enable_ceph | bool and nova_backend == "rbd" - - inventory_hostname in groups['ceph-mon'] or - inventory_hostname in groups['compute'] or - inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-conductor'] or - inventory_hostname in groups['nova-consoleauth'] or - inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] - -- include: external-ceph.yml - when: - - enable_ceph | bool == False and nova_backend == "rbd" - - inventory_hostname in groups['compute'] - -- include: register.yml - when: inventory_hostname in groups['nova-api'] - -- include: config.yml - when: inventory_hostname in groups['compute'] or - inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-conductor'] or - inventory_hostname in groups['nova-consoleauth'] or - inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] - -- include: config-nova-fake.yml - when: - - enable_nova_fake | bool - - inventory_hostname in groups['compute'] - -- include: bootstrap.yml - when: inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['compute'] - -- include: start.yml - when: inventory_hostname in groups['compute'] or - inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-conductor'] or - inventory_hostname in groups['nova-consoleauth'] or - inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] diff --git a/ansible/roles/nova/tasks/external-ceph.yml b/ansible/roles/nova/tasks/external-ceph.yml deleted file mode 100644 index 8743e7702..000000000 --- a/ansible/roles/nova/tasks/external-ceph.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - with_items: - - "nova-compute" - - "nova-libvirt/secrets" - when: inventory_hostname in groups['compute'] - -- name: Find keyring files - local_action: find paths="{{ node_custom_config }}/nova/" patterns="^ceph\.client\..*?\.keyring$" use_regex=True - register: cephx_keyring_files - -- name: Copy over ceph keyring file - copy: - src: "{{ cephx_keyring_files.files[0].path }}" - dest: "{{ node_config_directory }}/{{item}}/" - with_items: - - nova-compute - - nova-libvirt - when: inventory_hostname in groups['compute'] - -- name: Copy over ceph.conf - copy: - src: "{{ node_custom_config }}/nova/ceph.conf" - dest: "{{ node_config_directory }}/{{ item }}/" - with_items: - - nova-compute - - nova-libvirt - when: inventory_hostname in groups['compute'] - -- name: Pushing secrets xml for libvirt - template: - src: "secret.xml.j2" - dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ rbd_secret_uuid }}.xml" - mode: "0600" - when: inventory_hostname in groups['compute'] - -- name: Extract key from file - local_action: shell cat {{ cephx_keyring_files.files[0].path }} | grep -E 'key\s*=' | awk '{ print $3 }' - register: cephx_raw_key - -- name: Pushing secrets key for libvirt - copy: - content: "{{ cephx_raw_key.stdout }}" - dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ rbd_secret_uuid }}.base64" - mode: "0600" - when: inventory_hostname in groups['compute'] diff --git a/ansible/roles/nova/tasks/main.yml b/ansible/roles/nova/tasks/main.yml deleted file mode 100644 index b017e8b4a..000000000 --- a/ansible/roles/nova/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: "{{ action }}.yml" diff --git a/ansible/roles/nova/tasks/precheck.yml b/ansible/roles/nova/tasks/precheck.yml deleted file mode 100644 index ed97d539c..000000000 --- a/ansible/roles/nova/tasks/precheck.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/ansible/roles/nova/tasks/pull.yml b/ansible/roles/nova/tasks/pull.yml deleted file mode 100644 index 6d067ab7e..000000000 --- a/ansible/roles/nova/tasks/pull.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -- name: Pulling nova-api image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_api_image_full }}" - when: inventory_hostname in groups['nova-api'] - -- name: Pulling nova-compute image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_compute_image_full }}" - when: - - inventory_hostname in groups['compute'] - - not enable_nova_fake | bool - -- name: Pulling nova-compute-ironic image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_compute_ironic_image_full }}" - when: - - inventory_hostname in groups['nova-compute-ironic'] - - enable_ironic | bool - -- name: Pulling nova-conductor image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_conductor_image_full }}" - when: inventory_hostname in groups['nova-conductor'] - -- name: Pulling nova-consoleauth image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_consoleauth_image_full }}" - when: inventory_hostname in groups['nova-consoleauth'] - -- name: Pulling nova-libvirt image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_libvirt_image_full }}" - when: inventory_hostname in groups['compute'] - -- name: Pulling nova-ssh image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_ssh_image_full }}" - when: inventory_hostname in groups['compute'] - -- name: Pulling nova-novncproxy image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_novncproxy_image_full }}" - when: - - inventory_hostname in groups['nova-novncproxy'] - - nova_console == 'novnc' - -- name: Pulling nova-scheduler image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_scheduler_image_full }}" - when: inventory_hostname in groups['nova-scheduler'] - -- name: Pulling nova-spicehtml5proxy image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ nova_spicehtml5proxy_image_full }}" - when: - - inventory_hostname in groups['nova-spicehtml5proxy'] - - nova_console == 'spice' diff --git a/ansible/roles/nova/tasks/reconfigure.yml b/ansible/roles/nova/tasks/reconfigure.yml deleted file mode 100644 index b551dd92a..000000000 --- a/ansible/roles/nova/tasks/reconfigure.yml +++ /dev/null @@ -1,318 +0,0 @@ ---- -- name: Ensuring the nova libvirt, ssh, conductor, api, consoleauth and scheduler containers are up - kolla_docker: - name: "{{ item.name }}" - action: "get_container_state" - register: container_state - failed_when: container_state.Running == false - when: inventory_hostname in groups[item.group] - with_items: - - { name: nova_libvirt, group: compute } - - { name: nova_ssh, group: compute } - - { name: nova_conductor, group: nova-conductor } - - { name: nova_api, group: nova-api } - - { name: nova_consoleauth, group: nova-consoleauth } - - { name: nova_scheduler, group: nova-scheduler } - -- name: Ensuring the nova_compute container is up - kolla_docker: - name: "nova_compute" - action: "get_container_state" - register: container_state - failed_when: container_state.Running == false - when: - - not enable_nova_fake | bool - - inventory_hostname in groups['compute'] - -- name: Ensuring the nova_compute_ironic container is up - kolla_docker: - name: "nova_compute_ironic" - action: "get_container_state" - register: container_state - failed_when: container_state.Running == false - when: - - enable_ironic | bool - - inventory_hostname in groups['nova-compute-ironic'] - -- name: Ensuring the nova_novncproxy container is up - kolla_docker: - name: "nova_novncproxy" - action: "get_container_state" - register: container_state - failed_when: container_state.Running == false - when: - - nova_console == 'novnc' - - inventory_hostname in groups['nova-novncproxy'] - -- name: Ensuring the nova_spicehtml5proxy container is up - kolla_docker: - name: "nova_spicehtml5proxy" - action: "get_container_state" - register: container_state - failed_when: container_state.Running == false - when: - - nova_console == 'spice' - - inventory_hostname in groups['nova-spicehtml5proxy'] - -- include: config.yml - -- name: Check the configs for nova libvirt, ssh, conductor, api, consoleauth and scheduler containers - command: docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check - changed_when: false - failed_when: false - register: check_results - when: inventory_hostname in groups[item.group] - with_items: - - { name: nova_libvirt, group: compute } - - { name: nova_ssh, group: compute } - - { name: nova_conductor, group: nova-conductor } - - { name: nova_api, group: nova-api } - - { name: nova_consoleauth, group: nova-consoleauth } - - { name: nova_scheduler, group: nova-scheduler } - -- name: Check the configs in the nova_compute container - command: docker exec nova_compute /usr/local/bin/kolla_set_configs --check - changed_when: false - failed_when: false - register: nova_compute_check_result - when: - - not enable_nova_fake | bool - - inventory_hostname in groups['compute'] - -- name: Check the configs in the nova_compute_ironic container - command: docker exec nova_compute_ironic /usr/local/bin/kolla_set_configs --check - changed_when: false - failed_when: false - register: nova_compute_ironic_check_result - when: - - enable_ironic | bool - - inventory_hostname in groups['nova-compute-ironic'] - -- name: Check the configs in the nova_novncproxy container - command: docker exec nova_novncproxy /usr/local/bin/kolla_set_configs --check - changed_when: false - failed_when: false - register: nova_novncproxy_check_result - when: - - nova_console == 'novnc' - - inventory_hostname in groups['nova-novncproxy'] - -- name: Check the configs in the nova_spicehtml5proxy container - command: docker exec nova_spicehtml5proxy /usr/local/bin/kolla_set_configs --check - changed_when: false - failed_when: false - register: nova_spicehtml5proxy_check_result - when: - - nova_console == 'spice' - - inventory_hostname in groups['nova-spicehtml5proxy'] - -# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS' -# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE', -# just remove the container and start again -- name: Containers config strategy for nova libvirt, ssh, conductor, api, consoleauth and scheduler containers - kolla_docker: - name: "{{ item.name }}" - action: "get_container_env" - register: container_envs - when: inventory_hostname in groups[item.group] - with_items: - - { name: nova_libvirt, group: compute } - - { name: nova_ssh, group: compute } - - { name: nova_conductor, group: nova-conductor } - - { name: nova_api, group: nova-api } - - { name: nova_consoleauth, group: nova-consoleauth } - - { name: nova_scheduler, group: nova-scheduler } - -- name: Container config strategy for nova_compute - kolla_docker: - name: nova_compute - action: "get_container_env" - register: nova_compute_container_env - when: - - not enable_nova_fake | bool - - inventory_hostname in groups['compute'] - -- name: Container config strategy for nova_compute_ironic - kolla_docker: - name: nova_compute_ironic - action: "get_container_env" - register: nova_compute_ironic_container_env - when: - - enable_ironic | bool - - inventory_hostname in groups['nova-compute-ironic'] - -- name: Container config strategy for nova_novncproxy - kolla_docker: - name: nova_novncproxy - action: "get_container_env" - register: nova_novncproxy_container_env - when: - - nova_console == 'novnc' - - inventory_hostname in groups['nova-novncproxy'] - -- name: Container config strategy for nova_spicehtml5proxy - kolla_docker: - name: nova_spicehtml5proxy - action: "get_container_env" - register: nova_spicehtml5proxy_container_env - when: - - nova_console == 'spice' - - inventory_hostname in groups['nova-spicehtml5proxy'] - -- name: Remove the nova libvirt, ssh, conductor, api, consoleauth and scheduler containers - kolla_docker: - name: "{{ item[0]['name'] }}" - action: "remove_container" - register: remove_containers - until: remote_container|success - retries: "{{ item[0]['retries']|default(0) }}" - when: - - inventory_hostname in groups[item[0]['group']] - - config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE' - - item[2]['rc'] == 1 - with_together: - # NOTE(Jeffrey4l): retry 1 to remove nova_libvirt container because when - # guests running, nova_libvirt will raise error even though it is removed. - - [{ name: nova_libvirt, group: compute, retries: 1 }, - { name: nova_ssh, group: compute }, - { name: nova_conductor, group: nova-conductor }, - { name: nova_api, group: nova-api }, - { name: nova_consoleauth, group: nova-consoleauth }, - { name: nova_scheduler, group: nova-scheduler }] - - "{{ container_envs.results }}" - - "{{ check_results.results }}" - -- name: Remove nova_compute container - kolla_docker: - name: nova_compute - action: "remove_container" - register: remove_nova_compute_container - when: - - not enable_nova_fake | bool - - inventory_hostname in groups['compute'] - - config_strategy == 'COPY_ONCE' or nova_compute_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE' - - nova_compute_check_result['rc'] == 1 - -- name: Remove nova_compute_ironic container - kolla_docker: - name: nova_compute_ironic - action: "remove_container" - register: remove_nova_compute_ironic_container - when: - - enable_ironic | bool - - inventory_hostname in groups['nova-compute-ironic'] - - config_strategy == 'COPY_ONCE' or nova_compute_ironic_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE' - - nova_compute_ironic_check_result['rc'] == 1 - -- name: Remove nova_novncproxy container - kolla_docker: - name: nova_novncproxy - action: "remove_container" - register: remove_nova_novncproxy_container - when: - - nova_console == 'novnc' - - inventory_hostname in groups['nova-novncproxy'] - - config_strategy == 'COPY_ONCE' or nova_novncproxy_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE' - - nova_novncproxy_check_result['rc'] == 1 - -- name: Remove nova_spicehtml5proxy container - kolla_docker: - name: nova_spicehtml5proxy - action: "remove_container" - register: remove_nova_spicehtml5proxy_container - when: - - nova_console == 'spice' - - inventory_hostname in groups['nova-spicehtml5proxy'] - - config_strategy == 'COPY_ONCE' or nova_spicehtml5proxy_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE' - - nova_spicehtml5proxy_check_result['rc'] == 1 - -- include: start.yml - when: remove_containers.changed - -- include: start.yml - when: - - not enable_nova_fake | bool - - remove_nova_compute_container.changed - -- include: start.yml - when: - - enable_ironic | bool - - remove_nova_compute_ironic_container.changed - -- include: start.yml - when: - - enable_ironic | bool - - remove_nova_compute_ironic_container.changed - -- include: start.yml - when: - - nova_console == 'novnc' - - remove_nova_novncproxy_container.changed - -- include: start.yml - when: - - nova_console == 'spice' - - remove_nova_spicehtml5proxy_container.changed - -- name: Restart the nova libvirt, ssh, conductor, api, consoleauth and scheduler containers - kolla_docker: - name: "{{ item[0]['name'] }}" - action: "restart_container" - when: - - config_strategy == 'COPY_ALWAYS' - - inventory_hostname in groups[item[0]['group']] - - item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - item[2]['rc'] == 1 - with_together: - - [{ name: nova_libvirt, group: compute }, - { name: nova_ssh, group: compute }, - { name: nova_conductor, group: nova-conductor }, - { name: nova_api, group: nova-api }, - { name: nova_consoleauth, group: nova-consoleauth }, - { name: nova_scheduler, group: nova-scheduler }] - - "{{ container_envs.results }}" - - "{{ check_results.results }}" - -- name: Restart the nova_compute container - kolla_docker: - name: "nova_compute" - action: "restart_container" - when: - - not enable_nova_fake | bool - - config_strategy == 'COPY_ALWAYS' - - inventory_hostname in groups['compute'] - - nova_compute_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - nova_compute_check_result['rc'] == 1 - -- name: Restart the nova_compute_ironic container - kolla_docker: - name: "nova_compute_ironic" - action: "restart_container" - when: - - enable_ironic | bool - - config_strategy == 'COPY_ALWAYS' - - inventory_hostname in groups['nova-compute-ironic'] - - nova_compute_ironic_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - nova_compute_ironic_check_result['rc'] == 1 - -- name: Restart the nova_novncproxy container - kolla_docker: - name: "nova_novncproxy" - action: "restart_container" - when: - - nova_console == 'novnc' - - config_strategy == 'COPY_ALWAYS' - - inventory_hostname in groups['nova-novncproxy'] - - nova_novncproxy_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - nova_novncproxy_check_result['rc'] == 1 - -- name: Restart the nova_spicehtml5proxy container - kolla_docker: - name: "nova_spicehtml5proxy" - action: "restart_container" - when: - - nova_console == 'spice' - - config_strategy == 'COPY_ALWAYS' - - inventory_hostname in groups['nova-spicehtml5proxy'] - - nova_spicehtml5proxy_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - nova_spicehtml5proxy_check_result['rc'] == 1 diff --git a/ansible/roles/nova/tasks/register.yml b/ansible/roles/nova/tasks/register.yml deleted file mode 100644 index a1b87e5c1..000000000 --- a/ansible/roles/nova/tasks/register.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- name: Creating the Nova service and endpoint - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_service - -a "service_name={{ item.name }} - service_type={{ item.service_type }} - description='{{ item.description }}' - endpoint_region={{ openstack_region_name }} - url='{{ item.url }}' - interface='{{ item.interface }}' - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_nova_auth }}' }}" - -e "{'openstack_nova_auth':{{ openstack_nova_auth }}}" - register: nova_endpoint - changed_when: "{{ nova_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (nova_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: nova_endpoint.stdout.split()[2] == 'SUCCESS' - retries: 10 - delay: 5 - run_once: True - with_items: - - {'name': 'nova_legacy', 'service_type': 'compute_legacy', 'interface': 'admin', 'url': '{{ nova_legacy_admin_endpoint }}', 'description': 'OpenStack Compute Service (Legacy 2.0)'} - - {'name': 'nova_legacy', 'service_type': 'compute_legacy', 'interface': 'internal', 'url': '{{ nova_legacy_internal_endpoint }}', 'description': 'OpenStack Compute Service (Legacy 2.0)'} - - {'name': 'nova_legacy', 'service_type': 'compute_legacy', 'interface': 'public', 'url': '{{ nova_legacy_public_endpoint }}', 'description': 'OpenStack Compute Service (Legacy 2.0)'} - - {'name': 'nova', 'service_type': 'compute', 'interface': 'admin', 'url': '{{ nova_admin_endpoint }}', 'description': 'OpenStack Compute Service'} - - {'name': 'nova', 'service_type': 'compute', 'interface': 'internal', 'url': '{{ nova_internal_endpoint }}', 'description': 'OpenStack Compute Service'} - - {'name': 'nova', 'service_type': 'compute', 'interface': 'public', 'url': '{{ nova_public_endpoint }}', 'description': 'OpenStack Compute Service'} - -- name: Creating the Nova project, user, and role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m kolla_keystone_user - -a "project=service - user=nova - password={{ nova_keystone_password }} - role=admin - region_name={{ openstack_region_name }} - auth={{ '{{ openstack_nova_auth }}' }}" - -e "{'openstack_nova_auth':{{ openstack_nova_auth }}}" - register: nova_user - changed_when: "{{ nova_user.stdout.find('localhost | SUCCESS => ') != -1 and (nova_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: nova_user.stdout.split()[2] == 'SUCCESS' - retries: 10 - delay: 5 - run_once: True diff --git a/ansible/roles/nova/tasks/reload.yml b/ansible/roles/nova/tasks/reload.yml deleted file mode 100644 index 6b37a9091..000000000 --- a/ansible/roles/nova/tasks/reload.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# This play calls sighup on every service to refresh upgrade levels -- name: Sighup nova-api - command: docker exec -t nova_api kill -1 1 - when: inventory_hostname in groups['nova-api'] - -- name: Sighup nova-conductor - command: docker exec -t nova_conductor kill -1 1 - when: inventory_hostname in groups['nova-conductor'] - -- name: Sighup nova-consoleauth - command: docker exec -t nova_consoleauth kill -1 1 - when: inventory_hostname in groups['nova-consoleauth'] - -- name: Sighup nova-scheduler - command: docker exec -t nova_scheduler kill -1 1 - when: inventory_hostname in groups['nova-scheduler'] - -- name: Sighup nova-compute - command: docker exec -t nova_compute kill -1 1 - when: inventory_hostname in groups['compute'] diff --git a/ansible/roles/nova/tasks/start.yml b/ansible/roles/nova/tasks/start.yml deleted file mode 100644 index 659729b19..000000000 --- a/ansible/roles/nova/tasks/start.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- include: start_controllers.yml - -- include: start_conductors.yml - -- include: start_compute.yml diff --git a/ansible/roles/nova/tasks/start_compute.yml b/ansible/roles/nova/tasks/start_compute.yml deleted file mode 100644 index d40e7a007..000000000 --- a/ansible/roles/nova/tasks/start_compute.yml +++ /dev/null @@ -1,103 +0,0 @@ ---- -- name: Starting nova-libvirt container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_libvirt_image_full }}" - name: "nova_libvirt" - pid_mode: "host" - privileged: True - volumes: - - "{{ node_config_directory }}/nova-libvirt/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "/lib/modules:/lib/modules:ro" - - "/run/:/run/:shared" - - "/dev:/dev" - - "/sys/fs/cgroup:/sys/fs/cgroup" - - "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 - # guests running, nova_libvirt will raise error even though it is removed. - retries: 5 - until: start_nova_libvirt_container|success - when: inventory_hostname in groups['compute'] - -- name: Prepare volumes list - set_fact: - mounts: - - "{{ node_config_directory }}/nova-compute/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "/lib/modules:/lib/modules:ro" - - "/run:/run:shared" - - "/dev:/dev" - - "kolla_logs:/var/log/kolla/" - - "{% 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: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_compute_image_full }}" - name: "nova_compute" - privileged: True - volumes: '{{ mounts | reject("equalto", "") | list}}' - when: - - inventory_hostname in groups['compute'] - - not enable_nova_fake | bool - - not enable_ironic | bool - -- name: Starting nova-compute-ironic container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_compute_ironic_image_full }}" - name: "nova_compute_ironic" - volumes: - - "{{ node_config_directory }}/nova-compute-ironic/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: - - inventory_hostname in groups['nova-compute-ironic'] - - enable_ironic | bool - -- name: Starting nova-compute-fake containers - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_compute_image_full }}" - name: "nova_compute_fake_{{ item }}" - privileged: True - volumes: - - "{{ node_config_directory }}/nova-compute-fake-{{ item }}/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "/lib/modules:/lib/modules:ro" - - "/run:/run:shared" - - "kolla_logs:/var/log/kolla/" - with_sequence: start=1 end={{ num_nova_fake_per_node }} - when: - - inventory_hostname in groups['compute'] - - enable_nova_fake | bool - -- name: Starting nova-ssh container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_ssh_image_full }}" - name: "nova_ssh" - volumes: - - "{{ node_config_directory }}/nova-ssh/:{{ container_config_directory }}/:ro" - - "/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 - when: inventory_hostname in groups['compute'] diff --git a/ansible/roles/nova/tasks/start_conductors.yml b/ansible/roles/nova/tasks/start_conductors.yml deleted file mode 100644 index aa5fe4dd0..000000000 --- a/ansible/roles/nova/tasks/start_conductors.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Starting nova-conductor container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - name: "nova_conductor" - image: "{{ nova_conductor_image_full }}" - volumes: - - "{{ node_config_directory }}/nova-conductor/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: inventory_hostname in groups['nova-conductor'] diff --git a/ansible/roles/nova/tasks/start_controllers.yml b/ansible/roles/nova/tasks/start_controllers.yml deleted file mode 100644 index 184927281..000000000 --- a/ansible/roles/nova/tasks/start_controllers.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- name: Starting nova-api container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_api_image_full }}" - name: "nova_api" - privileged: True - volumes: - - "{{ node_config_directory }}/nova-api/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "/lib/modules:/lib/modules:ro" - - "kolla_logs:/var/log/kolla/" - when: inventory_hostname in groups['nova-api'] - -- name: Starting nova-consoleauth container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_consoleauth_image_full }}" - name: "nova_consoleauth" - volumes: - - "{{ node_config_directory }}/nova-consoleauth/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: inventory_hostname in groups['nova-consoleauth'] - -- name: Starting nova-novncproxy container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_novncproxy_image_full }}" - name: "nova_novncproxy" - volumes: - - "{{ node_config_directory }}/nova-novncproxy/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: - - inventory_hostname in groups['nova-novncproxy'] - - nova_console == 'novnc' - -- name: Starting nova-scheduler container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_scheduler_image_full }}" - name: "nova_scheduler" - volumes: - - "{{ node_config_directory }}/nova-scheduler/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: inventory_hostname in groups['nova-scheduler'] - -- name: Starting nova-spicehtml5proxy container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ nova_spicehtml5proxy_image_full }}" - name: "nova_spicehtml5proxy" - volumes: - - "{{ node_config_directory }}/nova-spicehtml5proxy/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: - - inventory_hostname in groups['nova-spicehtml5proxy'] - - nova_console == 'spice' diff --git a/ansible/roles/nova/tasks/upgrade.yml b/ansible/roles/nova/tasks/upgrade.yml deleted file mode 100644 index bc24e375e..000000000 --- a/ansible/roles/nova/tasks/upgrade.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# Create new set of configs on nodes -- include: config.yml - -# TODO(inc0): since nova is creating new database in L->M, we need to call it. -# It should be removed later -- include: bootstrap.yml - -- include: bootstrap_service.yml - -- include: register.yml - -- name: Checking if conductor container needs upgrading - kolla_docker: - action: "compare_image" - common_options: "{{ docker_common_options }}" - name: "nova_conductor" - image: "{{ nova_conductor_image_full }}" - when: inventory_hostname in groups['nova-conductor'] - register: conductor_differs - -# Short downtime here, but from user perspective his call will just timeout or execute later -- name: Stopping all nova_conductor containers - kolla_docker: - action: "stop_container" - common_options: "{{ docker_common_options }}" - name: "nova_conductor" - when: - - inventory_hostname in groups['nova-conductor'] - - conductor_differs['result'] - -- include: start_conductors.yml - -- include: start_controllers.yml - -- include: start_compute.yml - -- include: reload.yml |
