Vasyl Saienko | 3f25ec6 | 2017-12-08 14:55:01 +0200 | [diff] [blame] | 1 | {% from "nova/map.jinja" import controller with context %} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 2 | |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 3 | {%- if controller.get('enabled') %} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 4 | |
Vasyl Saienko | c392a39 | 2018-08-06 16:00:41 +0000 | [diff] [blame] | 5 | include: |
Vasyl Saienko | e661e8c | 2018-08-21 20:07:03 +0000 | [diff] [blame] | 6 | {%- if controller.version not in ["juno", "kilo", "liberty", "mitaka", "newton"] %} |
Oleksandr Shyshko | 55eeac7 | 2018-08-03 18:23:28 +0300 | [diff] [blame] | 7 | - apache |
| 8 | {%- endif %} |
| 9 | - nova.db.offline_sync |
| 10 | # TODO(vsaienko) we need to run online dbsync only once after upgrade |
| 11 | # Move to appropriate upgrade phase |
| 12 | - nova.db.online_sync |
Oleksandr Shyshko | 55eeac7 | 2018-08-03 18:23:28 +0300 | [diff] [blame] | 13 | - nova._ssl.mysql |
Oleksandr Bryndzii | 1d5fa54 | 2018-09-13 14:18:08 +0000 | [diff] [blame] | 14 | - nova._ssl.rabbitmq |
Filip Pytloun | 4405176 | 2016-04-21 15:07:21 +0200 | [diff] [blame] | 15 | {%- if grains.os_family == 'Debian' %} |
Petr Michalec | 5f41e6e | 2017-04-10 10:18:12 +0200 | [diff] [blame] | 16 | debconf-set-prerequisite: |
| 17 | pkg.installed: |
| 18 | - name: debconf-utils |
| 19 | - require_in: |
| 20 | - debconf: nova_consoleproxy_debconf |
| 21 | |
Filip Pytloun | 4405176 | 2016-04-21 15:07:21 +0200 | [diff] [blame] | 22 | nova_consoleproxy_debconf: |
| 23 | debconf.set: |
| 24 | - name: nova-consoleproxy |
| 25 | - data: |
| 26 | 'nova-consoleproxy/daemon_type': |
| 27 | type: 'string' |
| 28 | value: 'novnc' |
| 29 | - require_in: |
| 30 | - pkg: nova_controller_packages |
| 31 | {%- endif %} |
| 32 | |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 33 | nova_controller_packages: |
| 34 | pkg.installed: |
| 35 | - names: {{ controller.pkgs }} |
| 36 | |
| 37 | {%- if not salt['user.info']('nova') %} |
| 38 | user_nova: |
| 39 | user.present: |
| 40 | - name: nova |
| 41 | - home: /var/lib/nova |
| 42 | - shell: /bin/false |
Dmitry Stremkovskiy | f596066 | 2017-07-05 20:12:56 +0300 | [diff] [blame] | 43 | {# note: nova uid/gid values would not be evaluated after user is created. #} |
| 44 | - uid: {{ controller.get('nova_uid', 303) }} |
| 45 | - gid: {{ controller.get('nova_gid', 303) }} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 46 | - system: True |
| 47 | - require_in: |
| 48 | - pkg: nova_controller_packages |
Oleksandr Shyshko | cbe8735 | 2018-09-07 13:42:57 +0300 | [diff] [blame] | 49 | - sls: nova._ssl.mysql |
Oleksandr Bryndzii | 1d5fa54 | 2018-09-13 14:18:08 +0000 | [diff] [blame] | 50 | - sls: nova._ssl.rabbitmq |
Mykyta Karpin | c4d0511 | 2018-04-04 12:52:06 +0300 | [diff] [blame] | 51 | {%- if controller.version not in ["juno", "kilo", "liberty", "mitaka", "newton"] %} |
| 52 | - pkg: nova_placement_package |
| 53 | {%- endif %} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 54 | |
| 55 | group_nova: |
| 56 | group.present: |
| 57 | - name: nova |
Dmitry Stremkovskiy | f596066 | 2017-07-05 20:12:56 +0300 | [diff] [blame] | 58 | {# note: nova gid value would not be evaluated after user is created. #} |
| 59 | - gid: {{ controller.get('nova_gid', 303) }} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 60 | - system: True |
| 61 | - require_in: |
| 62 | - user: user_nova |
| 63 | {%- endif %} |
| 64 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 65 | # Only for Queens. Communication between noVNC proxy service and QEMU |
| 66 | {%- if controller.version not in ['mitaka', 'newton', 'ocata', 'pike'] %} |
| 67 | {%- if controller.novncproxy.vencrypt.tls.get('enabled', False) %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 68 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 69 | {%- set ca_file=controller.novncproxy.vencrypt.tls.get('ca_file') %} |
| 70 | {%- set key_file=controller.novncproxy.vencrypt.tls.get('key_file') %} |
| 71 | {%- set cert_file=controller.novncproxy.vencrypt.tls.get('cert_file') %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 72 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 73 | novncproxy_vencrypt_ca: |
| 74 | {%- if controller.novncproxy.vencrypt.tls.cacert is defined %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 75 | file.managed: |
| 76 | - name: {{ ca_file }} |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 77 | - contents_pillar: nova:controller:novncproxy:vencrypt:tls:cacert |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 78 | - mode: 644 |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 79 | - makedirs: true |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 80 | - user: root |
| 81 | - group: nova |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 82 | - watch_in: |
| 83 | - service: nova_controller_services |
| 84 | {%- else %} |
| 85 | file.exists: |
| 86 | - name: {{ ca_file }} |
| 87 | {%- endif %} |
| 88 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 89 | novncproxy_vencrypt_public_cert: |
| 90 | {%- if controller.novncproxy.vencrypt.tls.cert is defined %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 91 | file.managed: |
| 92 | - name: {{ cert_file }} |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 93 | - contents_pillar: nova:controller:novncproxy:vencrypt:tls:cert |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 94 | - mode: 640 |
| 95 | - user: root |
| 96 | - group: nova |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 97 | - makedirs: true |
| 98 | {%- else %} |
| 99 | file.exists: |
| 100 | - name: {{ cert_file }} |
| 101 | {%- endif %} |
| 102 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 103 | novncproxy_vencrypt_private_key: |
| 104 | {%- if controller.novncproxy.vencrypt.tls.key is defined %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 105 | file.managed: |
| 106 | - name: {{ key_file }} |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 107 | - contents_pillar: nova:controller:novncproxy:vencrypt:tls:key |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 108 | - mode: 640 |
| 109 | - user: root |
| 110 | - group: nova |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 111 | - makedirs: true |
| 112 | {%- else %} |
| 113 | file.exists: |
| 114 | - name: {{ key_file }} |
| 115 | {%- endif %} |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 116 | |
| 117 | novncproxy_vencrypt_set_user_and_group: |
| 118 | file.managed: |
| 119 | - names: |
| 120 | - {{ ca_file }} |
| 121 | - {{ cert_file }} |
| 122 | - {{ key_file }} |
| 123 | - user: root |
| 124 | - group: nova |
| 125 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 126 | {%- endif %} |
| 127 | {%- endif %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 128 | |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 129 | {%- if controller.novncproxy.tls.get('enabled', False) %} |
| 130 | {%- set key_file=controller.novncproxy.tls.server.get('key_file') %} |
| 131 | {%- set cert_file=controller.novncproxy.tls.server.get('cert_file') %} |
| 132 | |
| 133 | novncproxy_server_public_cert: |
| 134 | {%- if controller.novncproxy.tls.server.cert is defined %} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 135 | file.managed: |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 136 | - name: {{ cert_file }} |
| 137 | - contents_pillar: nova:controller:novncproxy:tls:server:cert |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 138 | - mode: 644 |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 139 | - makedirs: true |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 140 | - user: root |
| 141 | - group: nova |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 142 | - watch_in: |
| 143 | - service: nova_controller_services |
| 144 | {%- else %} |
| 145 | file.exists: |
| 146 | - name: {{ cert_file }} |
| 147 | {%- endif %} |
| 148 | |
| 149 | novncproxy_server_private_key: |
| 150 | {%- if controller.novncproxy.tls.server.key is defined %} |
| 151 | file.managed: |
| 152 | - name: {{ key_file }} |
| 153 | - contents_pillar: nova:controller:novncproxy:tls:server:key |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 154 | - mode: 640 |
| 155 | - user: root |
| 156 | - group: nova |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 157 | - makedirs: true |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 158 | {%- else %} |
| 159 | file.exists: |
Oleksandr Shyshko | d8337cf | 2018-07-11 17:55:58 +0300 | [diff] [blame] | 160 | - name: {{ key_file }} |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 161 | {%- endif %} |
Vasyl Saienko | 55f3b71 | 2018-10-03 14:31:17 +0000 | [diff] [blame] | 162 | |
| 163 | novncproxy_server_set_user_and_group: |
| 164 | file.managed: |
| 165 | - names: |
| 166 | - {{ cert_file }} |
| 167 | - {{ key_file }} |
| 168 | - user: root |
| 169 | - group: nova |
| 170 | |
Oleksandr Shyshko | e6f983e | 2018-06-18 13:53:40 +0300 | [diff] [blame] | 171 | {%- endif %} |
| 172 | |
Jakub Pavlik | e0f72b4 | 2016-02-16 23:16:05 +0100 | [diff] [blame] | 173 | {%- if controller.get('networking', 'default') == "contrail" and controller.version == "juno" %} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 174 | |
| 175 | contrail_nova_packages: |
| 176 | pkg.installed: |
| 177 | - names: |
| 178 | - contrail-nova-driver |
| 179 | - contrail-nova-networkapi |
| 180 | |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 181 | {%- endif %} |
| 182 | |
Jakub Pavlik | e0f72b4 | 2016-02-16 23:16:05 +0100 | [diff] [blame] | 183 | /etc/nova/nova.conf: |
| 184 | file.managed: |
| 185 | - source: salt://nova/files/{{ controller.version }}/nova-controller.conf.{{ grains.os_family }} |
| 186 | - template: jinja |
| 187 | - require: |
| 188 | - pkg: nova_controller_packages |
Oleksandr Shyshko | 76f9244 | 2018-09-03 11:35:50 +0300 | [diff] [blame] | 189 | - sls: nova._ssl.mysql |
Oleksandr Bryndzii | 1d5fa54 | 2018-09-13 14:18:08 +0000 | [diff] [blame] | 190 | - sls: nova._ssl.rabbitmq |
Vasyl Saienko | c392a39 | 2018-08-06 16:00:41 +0000 | [diff] [blame] | 191 | - require_in: |
| 192 | - sls: nova.db.offline_sync |
| 193 | - sls: nova.db.online_sync |
Jakub Pavlik | e0f72b4 | 2016-02-16 23:16:05 +0100 | [diff] [blame] | 194 | |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 195 | /etc/nova/api-paste.ini: |
| 196 | file.managed: |
| 197 | - source: salt://nova/files/{{ controller.version }}/api-paste.ini.{{ grains.os_family }} |
| 198 | - template: jinja |
| 199 | - require: |
| 200 | - pkg: nova_controller_packages |
| 201 | |
Dmitry Kalashnik | e58fe08 | 2017-12-01 16:31:14 +0400 | [diff] [blame] | 202 | {% for service_name in controller.services %} |
| 203 | {{ service_name }}_default: |
| 204 | file.managed: |
| 205 | - name: /etc/default/{{ service_name }} |
| 206 | - source: salt://nova/files/default |
| 207 | - template: jinja |
| 208 | - require: |
| 209 | - pkg: nova_controller_packages |
| 210 | - defaults: |
| 211 | service_name: {{ service_name }} |
| 212 | values: {{ controller }} |
| 213 | - require: |
| 214 | - pkg: nova_controller_packages |
| 215 | - watch_in: |
| 216 | - service: nova_controller_services |
| 217 | {% endfor %} |
| 218 | |
| 219 | {% if controller.logging.log_appender %} |
| 220 | |
| 221 | {%- if controller.logging.log_handlers.get('fluentd').get('enabled', False) %} |
| 222 | nova_controller_fluentd_logger_package: |
| 223 | pkg.installed: |
| 224 | - name: python-fluent-logger |
| 225 | {%- endif %} |
| 226 | |
| 227 | nova_general_logging_conf: |
| 228 | file.managed: |
| 229 | - name: /etc/nova/logging.conf |
sgarbuz | 1a153a7 | 2018-07-13 14:55:08 +0300 | [diff] [blame] | 230 | - source: salt://oslo_templates/files/logging/_logging.conf |
Dmitry Kalashnik | e58fe08 | 2017-12-01 16:31:14 +0400 | [diff] [blame] | 231 | - template: jinja |
| 232 | - user: nova |
| 233 | - group: nova |
sgarbuz | 1496160 | 2018-09-03 10:24:25 +0300 | [diff] [blame] | 234 | - require_in: |
| 235 | - sls: nova.db.offline_sync |
Dmitry Kalashnik | e58fe08 | 2017-12-01 16:31:14 +0400 | [diff] [blame] | 236 | - require: |
| 237 | - pkg: nova_controller_packages |
| 238 | {%- if controller.logging.log_handlers.get('fluentd').get('enabled', False) %} |
| 239 | - pkg: nova_controller_fluentd_logger_package |
| 240 | {%- endif %} |
| 241 | - defaults: |
| 242 | service_name: nova |
sgarbuz | 1a153a7 | 2018-07-13 14:55:08 +0300 | [diff] [blame] | 243 | _data: {{ controller.logging }} |
Dmitry Kalashnik | e58fe08 | 2017-12-01 16:31:14 +0400 | [diff] [blame] | 244 | - watch_in: |
| 245 | - service: nova_controller_services |
| 246 | |
| 247 | /var/log/nova/nova.log: |
| 248 | file.managed: |
| 249 | - user: nova |
| 250 | - group: nova |
| 251 | - watch_in: |
| 252 | - service: nova_controller_services |
| 253 | {%- if controller.version not in ["juno", "kilo", "liberty", "mitaka", "newton"] %} |
| 254 | - service: nova_apache_restart |
| 255 | {%- endif %} |
| 256 | |
| 257 | {% for service_name in controller.services %} |
| 258 | |
| 259 | {{ service_name }}_logging_conf: |
| 260 | file.managed: |
| 261 | - name: /etc/nova/logging/logging-{{ service_name }}.conf |
sgarbuz | 1a153a7 | 2018-07-13 14:55:08 +0300 | [diff] [blame] | 262 | - source: salt://oslo_templates/files/logging/_logging.conf |
Dmitry Kalashnik | e58fe08 | 2017-12-01 16:31:14 +0400 | [diff] [blame] | 263 | - template: jinja |
| 264 | - user: nova |
| 265 | - group: nova |
| 266 | - require: |
| 267 | - pkg: nova_controller_packages |
| 268 | {%- if controller.logging.log_handlers.get('fluentd').get('enabled', False) %} |
| 269 | - pkg: nova_controller_fluentd_logger_package |
| 270 | {%- endif %} |
| 271 | - makedirs: True |
| 272 | - defaults: |
| 273 | service_name: {{ service_name }} |
sgarbuz | 1a153a7 | 2018-07-13 14:55:08 +0300 | [diff] [blame] | 274 | _data: {{ controller.logging }} |
Dmitry Kalashnik | e58fe08 | 2017-12-01 16:31:14 +0400 | [diff] [blame] | 275 | - watch_in: |
| 276 | - service: nova_controller_services |
| 277 | {%- if controller.version not in ["juno", "kilo", "liberty", "mitaka", "newton"] %} |
| 278 | - service: nova_apache_restart |
| 279 | {%- endif %} |
| 280 | |
| 281 | {% endfor %} |
| 282 | {% endif %} |
| 283 | |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 284 | {% if controller.get('policy', {}) and controller.version not in ['liberty', 'mitaka', 'newton'] %} |
| 285 | {# nova no longer ships with a default policy.json #} |
| 286 | |
| 287 | /etc/nova/policy.json: |
| 288 | file.managed: |
| 289 | - contents: '{}' |
| 290 | - replace: False |
| 291 | - user: nova |
| 292 | - group: nova |
| 293 | - require: |
| 294 | - pkg: nova_controller_packages |
| 295 | |
| 296 | {% endif %} |
| 297 | |
Dmitry Ukov | 3562a08 | 2017-05-04 00:00:48 +0400 | [diff] [blame] | 298 | {%- for name, rule in controller.get('policy', {}).iteritems() %} |
| 299 | |
| 300 | {%- if rule != None %} |
Martin Polreich | 62bbaa7 | 2018-06-20 14:24:41 +0200 | [diff] [blame] | 301 | nova_keystone_rule_{{ name }}_present: |
Dmitry Ukov | 3562a08 | 2017-05-04 00:00:48 +0400 | [diff] [blame] | 302 | keystone_policy.rule_present: |
| 303 | - path: /etc/nova/policy.json |
| 304 | - name: {{ name }} |
| 305 | - rule: {{ rule }} |
| 306 | - require: |
| 307 | - pkg: nova_controller_packages |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 308 | {% if controller.version not in ['liberty', 'mitaka', 'newton'] %} |
| 309 | - file: /etc/nova/policy.json |
| 310 | {% endif%} |
Dmitry Ukov | 3562a08 | 2017-05-04 00:00:48 +0400 | [diff] [blame] | 311 | |
| 312 | {%- else %} |
| 313 | |
Martin Polreich | 62bbaa7 | 2018-06-20 14:24:41 +0200 | [diff] [blame] | 314 | nova_keystone_rule_{{ name }}_absent: |
Dmitry Ukov | 3562a08 | 2017-05-04 00:00:48 +0400 | [diff] [blame] | 315 | keystone_policy.rule_absent: |
| 316 | - path: /etc/nova/policy.json |
| 317 | - name: {{ name }} |
| 318 | - require: |
| 319 | - pkg: nova_controller_packages |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 320 | {% if controller.version not in ['liberty', 'mitaka', 'newton'] %} |
| 321 | - file: /etc/nova/policy.json |
| 322 | {% endif%} |
Dmitry Ukov | 3562a08 | 2017-05-04 00:00:48 +0400 | [diff] [blame] | 323 | |
| 324 | {%- endif %} |
| 325 | |
| 326 | {%- endfor %} |
| 327 | |
Oleh Hryhorov | fecb47b | 2017-10-30 18:50:53 +0200 | [diff] [blame] | 328 | {%- if controller.version not in ["juno", "kilo", "liberty", "mitaka", "newton"] %} |
Jiri Broulik | 789179a | 2018-02-13 16:16:46 +0100 | [diff] [blame] | 329 | {%- if controller.get('update_cells') %} |
| 330 | |
| 331 | nova_update_cell0: |
| 332 | novang.update_cell: |
| 333 | - name: "cell0" |
| 334 | - db_name: {{ controller.database.name }}_cell0 |
| 335 | - db_engine: {{ controller.database.engine }} |
| 336 | - db_password: {{ controller.database.password }} |
| 337 | - db_user: {{ controller.database.user }} |
| 338 | - db_address: {{ controller.database.host }} |
| 339 | {%- if grains.get('noservices') %} |
| 340 | - onlyif: /bin/false |
| 341 | {%- endif %} |
| 342 | |
| 343 | {%- set rabbit_port = controller.message_queue.get('port', 5671 if controller.message_queue.get('ssl',{}).get('enabled', False) else 5672) %} |
| 344 | |
| 345 | nova_update_cell1: |
| 346 | novang.update_cell: |
| 347 | - name: "cell1" |
| 348 | - db_name: {{ controller.database.name }} |
| 349 | {%- if controller.message_queue.members is defined %} |
ayaurov | 4c27ae3 | 2018-11-23 17:54:30 +0200 | [diff] [blame] | 350 | - transport_url: rabbit://{% for member in controller.message_queue.members -%} |
Jiri Broulik | 789179a | 2018-02-13 16:16:46 +0100 | [diff] [blame] | 351 | {{ controller.message_queue.user }}:{{ controller.message_queue.password }}@{{ member.host }}:{{ member.get('port', rabbit_port) }} |
| 352 | {%- if not loop.last -%},{%- endif -%} |
| 353 | {%- endfor -%} |
| 354 | /{{ controller.message_queue.virtual_host }} |
| 355 | {%- else %} |
| 356 | - transport_url: rabbit://{{ controller.message_queue.user }}:{{ controller.message_queue.password }}@{{ controller.message_queue.host }}:{{ rabbit_port}}/{{ controller.message_queue.virtual_host }} |
| 357 | {%- endif %} |
| 358 | - db_engine: {{ controller.database.engine }} |
| 359 | - db_password: {{ controller.database.password }} |
| 360 | - db_user: {{ controller.database.user }} |
| 361 | - db_address: {{ controller.database.host }} |
| 362 | {%- if grains.get('noservices') %} |
| 363 | - onlyif: /bin/false |
| 364 | {%- endif %} |
| 365 | |
| 366 | {%- endif %} |
| 367 | |
Andrey Shestakov | 339fc1d | 2017-05-17 19:36:38 +0300 | [diff] [blame] | 368 | nova_placement_service_mask: |
| 369 | file.symlink: |
| 370 | - name: /etc/systemd/system/nova-placement-api.service |
| 371 | - target: /dev/null |
| 372 | |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 373 | nova_placement_package: |
| 374 | pkg.installed: |
| 375 | - name: nova-placement-api |
Andrey Shestakov | 339fc1d | 2017-05-17 19:36:38 +0300 | [diff] [blame] | 376 | - require: |
| 377 | - file: nova_placement_service_mask |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 378 | |
Vasyl Saienko | 29656ce | 2018-03-03 05:27:59 +0200 | [diff] [blame] | 379 | {#- Creation of sites using templates is deprecated, sites should be generated by apache pillar, and enabled by barbican formula #} |
| 380 | {%- if pillar.get('apache', {}).get('server', {}).get('site', {}).nova_placement is not defined %} |
| 381 | |
| 382 | nova_placement_apache_conf_file: |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 383 | file.managed: |
Vasyl Saienko | 29656ce | 2018-03-03 05:27:59 +0200 | [diff] [blame] | 384 | - name: /etc/apache2/sites-available/nova-placement-api.conf |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 385 | - source: salt://nova/files/{{ controller.version }}/nova-placement-api.conf |
| 386 | - template: jinja |
| 387 | - require: |
| 388 | - pkg: nova_controller_packages |
| 389 | - pkg: nova_placement_package |
| 390 | |
Tatyana Leontovich | 18418df | 2017-04-28 15:52:55 +0300 | [diff] [blame] | 391 | placement_config: |
Vasyl Saienko | 29656ce | 2018-03-03 05:27:59 +0200 | [diff] [blame] | 392 | apache_site.enabled: |
| 393 | - name: nova-placement-api |
| 394 | - require: |
| 395 | - nova_placement_apache_conf_file |
| 396 | |
| 397 | {%- else %} |
| 398 | |
Vasyl Saienko | 29656ce | 2018-03-03 05:27:59 +0200 | [diff] [blame] | 399 | nova_cleanup_configs: |
| 400 | file.absent: |
| 401 | - names: |
| 402 | - '/etc/apache2/sites-available/nova-placement-api.conf' |
| 403 | - '/etc/apache2/sites-enabled/nova-placement-api.conf' |
| 404 | |
| 405 | nova_placement_apache_conf_file: |
| 406 | file.exists: |
| 407 | - name: /etc/apache2/sites-available/wsgi_nova_placement.conf |
| 408 | - require: |
| 409 | - pkg: nova_placement_package |
| 410 | - nova_cleanup_configs |
| 411 | |
| 412 | placement_config: |
| 413 | apache_site.enabled: |
| 414 | - name: wsgi_nova_placement |
| 415 | - require: |
| 416 | - nova_placement_apache_conf_file |
| 417 | |
| 418 | {%- endif %} |
Tatyana Leontovich | 18418df | 2017-04-28 15:52:55 +0300 | [diff] [blame] | 419 | |
Jiri Broulik | 5589c01 | 2017-06-20 11:28:52 +0200 | [diff] [blame] | 420 | nova_controller_discover_hosts: |
| 421 | cmd.run: |
Vladyslav Drok | f6d2c6c | 2018-05-25 18:06:02 +0300 | [diff] [blame] | 422 | - name: nova-manage cell_v2 discover_hosts --verbose |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 423 | {%- if grains.get('noservices') %} |
| 424 | - onlyif: /bin/false |
| 425 | {%- endif %} |
Mykyta Karpin | 600ff54 | 2018-12-20 13:57:03 +0200 | [diff] [blame] | 426 | - runas: 'nova' |
Jiri Broulik | 5589c01 | 2017-06-20 11:28:52 +0200 | [diff] [blame] | 427 | - require: |
Vasyl Saienko | 92b3419 | 2018-08-23 09:45:59 +0300 | [diff] [blame] | 428 | - sls: nova.db.offline_sync |
Jiri Broulik | 5589c01 | 2017-06-20 11:28:52 +0200 | [diff] [blame] | 429 | |
| 430 | nova_controller_map_instances: |
sgarbuz | 37664d8 | 2019-02-01 13:11:12 +0200 | [diff] [blame^] | 431 | novav21.instances_mapped_to_cell: |
Jiri Broulik | 5589c01 | 2017-06-20 11:28:52 +0200 | [diff] [blame] | 432 | - name: 'cell1' |
sgarbuz | 37664d8 | 2019-02-01 13:11:12 +0200 | [diff] [blame^] | 433 | - timeout: {{ controller.get('mapped_instances_interval', 60) }} |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 434 | {%- if grains.get('noservices') %} |
| 435 | - onlyif: /bin/false |
| 436 | {%- endif %} |
Jiri Broulik | 5589c01 | 2017-06-20 11:28:52 +0200 | [diff] [blame] | 437 | - require: |
| 438 | - cmd: nova_controller_discover_hosts |
| 439 | - pkg: nova_controller_packages |
| 440 | |
| 441 | {%- endif %} |
| 442 | |
Oleh Hryhorov | fecb47b | 2017-10-30 18:50:53 +0200 | [diff] [blame] | 443 | {%- if controller.version not in ["juno", "kilo", "liberty", "mitaka", "newton"] %} |
Jiri Broulik | 5589c01 | 2017-06-20 11:28:52 +0200 | [diff] [blame] | 444 | |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 445 | nova_apache_restart: |
| 446 | service.running: |
| 447 | - enable: true |
| 448 | - name: apache2 |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 449 | {%- if grains.get('noservices') %} |
| 450 | - onlyif: /bin/false |
| 451 | {%- endif %} |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 452 | - require: |
Vasyl Saienko | c392a39 | 2018-08-06 16:00:41 +0000 | [diff] [blame] | 453 | - sls: nova.db.offline_sync |
Oleksandr Shyshko | 55eeac7 | 2018-08-03 18:23:28 +0300 | [diff] [blame] | 454 | - sls: nova._ssl.mysql |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 455 | - watch: |
| 456 | - file: /etc/nova/nova.conf |
| 457 | - file: /etc/nova/api-paste.ini |
Vasyl Saienko | 29656ce | 2018-03-03 05:27:59 +0200 | [diff] [blame] | 458 | - nova_placement_apache_conf_file |
Vasyl Saienko | e661e8c | 2018-08-21 20:07:03 +0000 | [diff] [blame] | 459 | - placement_config |
Jakub Pavlik | 02a01c7 | 2017-04-11 16:04:51 +0200 | [diff] [blame] | 460 | |
| 461 | {%- endif %} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 462 | nova_controller_services: |
| 463 | service.running: |
| 464 | - enable: true |
| 465 | - names: {{ controller.services }} |
Kirill Bespalov | d9d5954 | 2017-06-30 00:10:33 +0300 | [diff] [blame] | 466 | {%- if grains.get('noservices') %} |
| 467 | - onlyif: /bin/false |
| 468 | {%- endif %} |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 469 | - require: |
Vasyl Saienko | c392a39 | 2018-08-06 16:00:41 +0000 | [diff] [blame] | 470 | - sls: nova.db.offline_sync |
Oleksandr Shyshko | 55eeac7 | 2018-08-03 18:23:28 +0300 | [diff] [blame] | 471 | - sls: nova._ssl.mysql |
Oleksandr Bryndzii | 1d5fa54 | 2018-09-13 14:18:08 +0000 | [diff] [blame] | 472 | - sls: nova._ssl.rabbitmq |
Oleksandr Shyshko | 798d1c4 | 2018-09-03 11:35:50 +0300 | [diff] [blame] | 473 | - require_in: |
| 474 | - sls: nova.db.online_sync |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 475 | - watch: |
| 476 | - file: /etc/nova/nova.conf |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 477 | - file: /etc/nova/api-paste.ini |
Filip Pytloun | 4a72d79 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 478 | |
Jakub Pavlik | 340acf4 | 2016-05-26 22:20:30 +0200 | [diff] [blame] | 479 | {%- if grains.get('virtual_subtype', None) == "Docker" %} |
| 480 | |
| 481 | nova_entrypoint: |
| 482 | file.managed: |
| 483 | - name: /entrypoint.sh |
| 484 | - template: jinja |
| 485 | - source: salt://nova/files/entrypoint.sh |
| 486 | - mode: 755 |
| 487 | |
| 488 | {%- endif %} |
| 489 | |
sgarbuz | 37664d8 | 2019-02-01 13:11:12 +0200 | [diff] [blame^] | 490 | {%- endif %} |