Merge "Adds pacemaker update_tasks for Pike minor update workflow" into stable/pike
authorJenkins <jenkins@review.openstack.org>
Tue, 10 Oct 2017 04:38:12 +0000 (04:38 +0000)
committerGerrit Code Review <review@openstack.org>
Tue, 10 Oct 2017 04:38:12 +0000 (04:38 +0000)
docker/services/database/mysql.yaml
docker/services/pacemaker/database/mysql.yaml
docker/services/sensu-client.yaml
network/service_net_map.j2.yaml
puppet/services/nova-base.yaml
puppet/services/nova-migration-target.yaml
puppet/services/tripleo-packages.yaml

index c434ab7..174acd4 100644 (file)
@@ -127,11 +127,26 @@ outputs:
             command: ['/bin/bash', '-c', 'chown -R mysql:mysql /var/log/mariadb']
         step_2:
           mysql_bootstrap:
+            start_order: 1
             detach: false
             image: *mysql_image
             net: host
+            user: root
             # Kolla bootstraps aren't idempotent, explicitly checking if bootstrap was done
-            command: ['bash', '-c', 'test -e /var/lib/mysql/mysql || kolla_start']
+            command:
+              - 'bash'
+              - '-ecx'
+              -
+                list_join:
+                  - "\n"
+                  - - 'if [ -e /var/lib/mysql/mysql ]; then exit 0; fi'
+                    - 'echo -e "\n[mysqld]\nwsrep_provider=none" >> /etc/my.cnf'
+                    - 'sudo -u mysql -E kolla_start'
+                    - 'mysqld_safe --skip-networking --wsrep-on=OFF &'
+                    - 'timeout ${DB_MAX_TIMEOUT} /bin/bash -c ''until mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" ping 2>/dev/null; do sleep 1; done'''
+                    - 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "CREATE USER ''mysql''@''localhost'';"'
+                    - 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "REVOKE ALL PRIVILEGES, GRANT OPTION FROM ''mysql''@''localhost'';"'
+                    - 'timeout ${DB_MAX_TIMEOUT} mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" shutdown'
             volumes: &mysql_volumes
               list_concat:
               -
@@ -143,7 +158,7 @@ outputs:
                 - /var/log/containers/mysql:/var/log/mariadb
               - if:
                 - internal_tls_enabled
-                - 
+                -
                   - list_join:
                     - ':'
                     - - {get_param: InternalTLSCAFile}
@@ -151,12 +166,13 @@ outputs:
                       - 'ro'
                   - /etc/pki/tls/certs/mysql.crt:/var/lib/kolla/config_files/src-tls/etc/pki/tls/certs/mysql.crt:ro
                   - /etc/pki/tls/private/mysql.key:/var/lib/kolla/config_files/src-tls/etc/pki/tls/private/mysql.key:ro
-                - null 
+                - null
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
               - KOLLA_BOOTSTRAP=True
               # NOTE(mandre) skip wsrep cluster status check
               - KOLLA_KUBERNETES=True
+              - DB_MAX_TIMEOUT=60
               -
                 list_join:
                   - '='
@@ -191,7 +207,7 @@ outputs:
               - /var/lib/config-data/mysql/root:/root:ro #provides .my.cnf
             - if:
               - internal_tls_enabled
-              - 
+              -
                 - list_join:
                   - ':'
                   - - {get_param: InternalTLSCAFile}
@@ -199,7 +215,7 @@ outputs:
                     - 'ro'
                 - /etc/pki/tls/certs/mysql.crt:/var/lib/kolla/config_files/src-tls/etc/pki/tls/certs/mysql.crt:ro
                 - /etc/pki/tls/private/mysql.key:/var/lib/kolla/config_files/src-tls/etc/pki/tls/private/mysql.key:ro
-              - null 
+              - null
       metadata_settings:
         get_attr: [MysqlPuppetBase, role_data, metadata_settings]
       host_prep_tasks:
index 39bbf42..a65117f 100644 (file)
@@ -97,6 +97,12 @@ outputs:
                   - 4567
                   - 4568
                   - 9200
+            tripleo::profile::pacemaker::database::mysql_bundle::bind_address:
+              str_replace:
+                template:
+                  "%{hiera('fqdn_$NETWORK')}"
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
           -
             if:
             - internal_tls_enabled
index b64231c..a535af4 100644 (file)
@@ -39,13 +39,17 @@ parameters:
   SensuDockerCheckCommand:
     type: string
     default: |
+      output=''
       for i in $(docker ps --format '{{.ID}}'); do
         if result=$(docker inspect --format='{{.State.Health.Status}}' $i 2>/dev/null); then
           if [ "$result" != 'healthy' ]; then
-            echo "$(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{json .State}}' $i)" && exit 2;
+            output="${output} ; $(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{(index .State.Health.Log 0).Output}}' $i)";
           fi
         fi
       done
+      if [ ! -z "${output}" ]; then
+        echo ${output:3} && exit 2;
+      fi
   SensuDockerCheckInterval:
     type: number
     description: The frequency in seconds the docker health check is executed.
index 54646c3..e19ccd8 100644 (file)
@@ -55,7 +55,6 @@ parameters:
       HeatApiCfnNetwork: internal_api
       HeatApiCloudwatchNetwork: internal_api
       NovaApiNetwork: internal_api
-      NovaColdMigrationNetwork: ctlplane
       NovaPlacementNetwork: internal_api
       NovaMetadataNetwork: internal_api
       NovaVncProxyNetwork: internal_api
index 08302ee..5539208 100644 (file)
@@ -159,7 +159,8 @@ outputs:
       service_name: nova_base
       config_settings:
         map_merge:
-        - nova::rabbit_password: {get_param: RabbitPassword}
+        - nova::my_ip: {get_param: [ServiceNetMap, NovaApiNetwork]}
+          nova::rabbit_password: {get_param: RabbitPassword}
           nova::rabbit_userid: {get_param: RabbitUserName}
           nova::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
           nova::rabbit_port: {get_param: RabbitClientPort}
index 0c2b419..e121d37 100644 (file)
@@ -55,8 +55,14 @@ outputs:
         tripleo::profile::base::nova::migration::target::ssh_localaddrs:
           - "%{hiera('cold_migration_ssh_inbound_addr')}"
           - "%{hiera('live_migration_ssh_inbound_addr')}"
-        live_migration_ssh_inbound_addr: {get_param: [ServiceNetMap, NovaLibvirtNetwork]}
-        cold_migration_ssh_inbound_addr: {get_param: [ServiceNetMap, NovaColdMigrationNetwork]}
+        live_migration_ssh_inbound_addr:
+          get_param:
+            - ServiceNetMap
+            - str_replace:
+                template: "ROLENAMEHostnameResolveNetwork"
+                params:
+                  ROLENAME: {get_param: RoleName}
+        cold_migration_ssh_inbound_addr: {get_param: [ServiceNetMap, NovaApiNetwork]}
         tripleo::profile::base::sshd::port:
           - 22
           - {get_param: MigrationSshPort}
index 766c752..bfdac3e 100644 (file)
@@ -53,6 +53,15 @@ outputs:
           fail: msg="rpm-python package was not present before this run! Check environment before re-running"
           when: rpm_python_check.changed != false
           tags: step0
+        - block:
+            - name: Upgrade os-net-config
+              yum: name=os-net-config state=latest
+            - name: take new os-net-config parameters into account now
+              command: os-net-config --no-activate -c /etc/os-net-config/config.json -v --detailed-exit-codes
+              register: os_net_config_upgrade
+              failed_when: os_net_config_upgrade.rc not in [0,2]
+              changed_when: os_net_config_upgrade.rc == 2
+          tags: step3
         - name: Update all packages
           tags: step3
           yum: name=* state=latest