Merge "Implement heat venv support"
This commit is contained in:
commit
c391837e86
@ -72,7 +72,11 @@
|
|||||||
tags:
|
tags:
|
||||||
- heat-logs
|
- heat-logs
|
||||||
roles:
|
roles:
|
||||||
- { role: "os_heat", tags: [ "os-heat" ] }
|
- role: "os_heat"
|
||||||
|
heat_venv_tag: "{{ openstack_release }}"
|
||||||
|
heat_galera_address: "{{ galera_address }}"
|
||||||
|
tags:
|
||||||
|
- "os-heat"
|
||||||
- role: "rsyslog_client"
|
- role: "rsyslog_client"
|
||||||
rsyslog_client_log_rotate_file: heat_log_rotate
|
rsyslog_client_log_rotate_file: heat_log_rotate
|
||||||
rsyslog_client_log_dir: "/var/log/heat"
|
rsyslog_client_log_dir: "/var/log/heat"
|
||||||
@ -85,7 +89,6 @@
|
|||||||
- "system-crontab-coordination"
|
- "system-crontab-coordination"
|
||||||
vars:
|
vars:
|
||||||
galera_address: "{{ internal_lb_vip_address }}"
|
galera_address: "{{ internal_lb_vip_address }}"
|
||||||
heat_galera_address: "{{ internal_lb_vip_address }}"
|
|
||||||
ansible_hostname: "{{ container_name }}"
|
ansible_hostname: "{{ container_name }}"
|
||||||
is_metal: "{{ properties.is_metal|default(false) }}"
|
is_metal: "{{ properties.is_metal|default(false) }}"
|
||||||
vars_files:
|
vars_files:
|
||||||
|
@ -16,15 +16,25 @@
|
|||||||
# The variables file used by the playbooks in the Heat-api group.
|
# The variables file used by the playbooks in the Heat-api group.
|
||||||
# These don't have to be explicitly imported by vars_files: they are autopopulated.
|
# These don't have to be explicitly imported by vars_files: they are autopopulated.
|
||||||
|
|
||||||
# Defines that the role will be deployed on a host machine
|
|
||||||
is_metal: true
|
|
||||||
|
|
||||||
# Enable/Disable Ceilometer
|
# Enable/Disable Ceilometer
|
||||||
heat_ceilometer_enabled: False
|
heat_ceilometer_enabled: False
|
||||||
|
|
||||||
## Verbosity Options
|
## Verbosity Options
|
||||||
debug: False
|
debug: False
|
||||||
verbose: True
|
verbose: True
|
||||||
|
|
||||||
|
# Name of the virtual env to deploy into
|
||||||
|
heat_venv_tag: untagged
|
||||||
|
heat_venv_bin: "/openstack/venvs/heat-{{ heat_venv_tag }}/bin"
|
||||||
|
|
||||||
|
# Set this to enable or disable installing in a venv
|
||||||
|
heat_venv_enabled: true
|
||||||
|
|
||||||
|
# The bin path defaults to the venv path however if installation in a
|
||||||
|
# venv is disabled the bin path will be dynamically set based on the
|
||||||
|
# system path used when the installing.
|
||||||
|
heat_bin: "{{ heat_venv_bin }}"
|
||||||
|
|
||||||
heat_fatal_deprecations: False
|
heat_fatal_deprecations: False
|
||||||
|
|
||||||
heat_clients_endpoint: internalURL
|
heat_clients_endpoint: internalURL
|
||||||
@ -144,6 +154,12 @@ heat_apt_packages:
|
|||||||
- rsync
|
- rsync
|
||||||
- libxslt1.1
|
- libxslt1.1
|
||||||
|
|
||||||
|
# Heat packages that must be installed before anything else
|
||||||
|
heat_requires_pip_packages:
|
||||||
|
- virtualenv
|
||||||
|
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
|
||||||
|
|
||||||
|
# Common pip packages
|
||||||
heat_pip_packages:
|
heat_pip_packages:
|
||||||
- keystonemiddleware
|
- keystonemiddleware
|
||||||
- PyMySQL
|
- PyMySQL
|
||||||
|
@ -40,9 +40,10 @@
|
|||||||
- heat-db-setup
|
- heat-db-setup
|
||||||
|
|
||||||
- name: Perform a heat DB sync
|
- name: Perform a heat DB sync
|
||||||
command: heat-manage db_sync
|
command: "{{ heat_bin }}/heat-manage db_sync"
|
||||||
sudo: yes
|
sudo: yes
|
||||||
sudo_user: "{{ heat_system_user_name }}"
|
sudo_user: "{{ heat_system_user_name }}"
|
||||||
tags:
|
tags:
|
||||||
- heat-db-sync
|
- heat-db-sync
|
||||||
- heat-setup
|
- heat-setup
|
||||||
|
- heat-command-bin
|
||||||
|
@ -57,7 +57,8 @@
|
|||||||
- name: Ensure heat user
|
- name: Ensure heat user
|
||||||
shell: |
|
shell: |
|
||||||
. {{ ansible_env.HOME }}/openrc
|
. {{ ansible_env.HOME }}/openrc
|
||||||
openstack --os-identity-api-version=3 \
|
{{ heat_bin }}/openstack \
|
||||||
|
--os-identity-api-version=3 \
|
||||||
--os-auth-url={{ keystone_service_adminurl_v3 }} \
|
--os-auth-url={{ keystone_service_adminurl_v3 }} \
|
||||||
--os-project-name={{ heat_project_name }} \
|
--os-project-name={{ heat_project_name }} \
|
||||||
--os-project-domain-name={{ heat_project_domain_name }} \
|
--os-project-domain-name={{ heat_project_domain_name }} \
|
||||||
@ -72,13 +73,16 @@
|
|||||||
- heat-domain
|
- heat-domain
|
||||||
- heat-domain-setup
|
- heat-domain-setup
|
||||||
- heat-config
|
- heat-config
|
||||||
|
- heat-command-bin
|
||||||
|
|
||||||
|
|
||||||
# TODO Change the keystone library to support adding
|
# TODO Change the keystone library to support adding
|
||||||
# a role to a user without specifying a project
|
# a role to a user without specifying a project
|
||||||
- name: Assign admin role to heat domain admin user
|
- name: Assign admin role to heat domain admin user
|
||||||
shell: |
|
shell: |
|
||||||
. {{ ansible_env.HOME }}/openrc
|
. {{ ansible_env.HOME }}/openrc
|
||||||
openstack --os-identity-api-version=3 \
|
{{ heat_bin }}/openstack \
|
||||||
|
--os-identity-api-version=3 \
|
||||||
--os-auth-url={{ keystone_service_adminurl_v3 }} \
|
--os-auth-url={{ keystone_service_adminurl_v3 }} \
|
||||||
--os-project-name={{ heat_project_name }} \
|
--os-project-name={{ heat_project_name }} \
|
||||||
--os-project-domain-name={{ heat_project_domain_name }} \
|
--os-project-domain-name={{ heat_project_domain_name }} \
|
||||||
@ -92,3 +96,4 @@
|
|||||||
- heat-domain
|
- heat-domain
|
||||||
- heat-domain-setup
|
- heat-domain-setup
|
||||||
- heat-config
|
- heat-config
|
||||||
|
- heat-command-bin
|
||||||
|
@ -34,9 +34,43 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
with_items: heat_apt_packages
|
with_items: heat_apt_packages
|
||||||
tags:
|
tags:
|
||||||
|
- heat-install
|
||||||
- heat-apt-packages
|
- heat-apt-packages
|
||||||
|
|
||||||
- name: Install pip packages
|
- name: Install requires pip packages
|
||||||
|
pip:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
extra_args: "{{ pip_install_options|default('') }}"
|
||||||
|
register: install_packages
|
||||||
|
until: install_packages|success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
with_items:
|
||||||
|
- "{{ heat_requires_pip_packages }}"
|
||||||
|
tags:
|
||||||
|
- heat-install
|
||||||
|
- heat-pip-packages
|
||||||
|
|
||||||
|
- name: Install pip packages (venv)
|
||||||
|
pip:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
virtualenv: "{{ heat_venv_bin | dirname }}"
|
||||||
|
virtualenv_site_packages: "no"
|
||||||
|
extra_args: "{{ pip_install_options|default('') }}"
|
||||||
|
register: install_packages
|
||||||
|
until: install_packages|success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
with_items:
|
||||||
|
- "{{ heat_pip_packages }}"
|
||||||
|
when: heat_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- heat-install
|
||||||
|
- heat-pip-packages
|
||||||
|
|
||||||
|
- name: Install pip packages (no venv)
|
||||||
pip:
|
pip:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
@ -47,5 +81,7 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ heat_pip_packages }}"
|
- "{{ heat_pip_packages }}"
|
||||||
|
when: not heat_venv_enabled | bool
|
||||||
tags:
|
tags:
|
||||||
|
- heat-install
|
||||||
- heat-pip-packages
|
- heat-pip-packages
|
||||||
|
@ -51,3 +51,19 @@
|
|||||||
- Restart heat services
|
- Restart heat services
|
||||||
tags:
|
tags:
|
||||||
- heat-config
|
- heat-config
|
||||||
|
|
||||||
|
- name: Get heat command path
|
||||||
|
command: which heat
|
||||||
|
register: heat_command_path
|
||||||
|
when:
|
||||||
|
- not heat_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- heat-command-bin
|
||||||
|
|
||||||
|
- name: Set heat command path
|
||||||
|
set_fact:
|
||||||
|
heat_bin: "{{ heat_command_path.stdout | dirname }}"
|
||||||
|
when:
|
||||||
|
- not heat_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- heat-command-bin
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
group: "{{ item.group|default(heat_system_group_name) }}"
|
group: "{{ item.group|default(heat_system_group_name) }}"
|
||||||
mode: "{{ item.mode|default('0755') }}"
|
mode: "{{ item.mode|default('0755') }}"
|
||||||
with_items:
|
with_items:
|
||||||
|
- { path: "/openstack", mode: "0755", owner: "root", group: "root" }
|
||||||
- { path: "/etc/heat" }
|
- { path: "/etc/heat" }
|
||||||
- { path: "/etc/heat/environment.d" }
|
- { path: "/etc/heat/environment.d" }
|
||||||
- { path: "/etc/heat/templates" }
|
- { path: "/etc/heat/templates" }
|
||||||
@ -50,6 +51,19 @@
|
|||||||
tags:
|
tags:
|
||||||
- heat-dirs
|
- heat-dirs
|
||||||
|
|
||||||
|
- name: Create heat venv dir
|
||||||
|
file:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ item.owner|default(heat_system_user_name) }}"
|
||||||
|
group: "{{ item.group|default(heat_system_group_name) }}"
|
||||||
|
with_items:
|
||||||
|
- { path: "/openstack/venvs", mode: "0755", owner: "root", group: "root" }
|
||||||
|
- { path: "{{ heat_venv_bin }}" }
|
||||||
|
when: heat_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- heat-dirs
|
||||||
|
|
||||||
- name: Create heat plugin dirs
|
- name: Create heat plugin dirs
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
@ -15,13 +15,12 @@
|
|||||||
|
|
||||||
- include: heat_pre_install.yml
|
- include: heat_pre_install.yml
|
||||||
- include: heat_install.yml
|
- include: heat_install.yml
|
||||||
|
- include: heat_post_install.yml
|
||||||
|
|
||||||
- include: heat_domain_setup.yml
|
- include: heat_domain_setup.yml
|
||||||
when: >
|
when: >
|
||||||
inventory_hostname == groups['heat_all'][0]
|
inventory_hostname == groups['heat_all'][0]
|
||||||
|
|
||||||
- include: heat_post_install.yml
|
|
||||||
|
|
||||||
- include: heat_db_setup.yml
|
- include: heat_db_setup.yml
|
||||||
when: >
|
when: >
|
||||||
inventory_hostname == groups['heat_all'][0]
|
inventory_hostname == groups['heat_all'][0]
|
||||||
|
@ -12,7 +12,7 @@ respawn
|
|||||||
respawn limit 10 5
|
respawn limit 10 5
|
||||||
|
|
||||||
# Set the RUNBIN environment variable
|
# Set the RUNBIN environment variable
|
||||||
env RUNBIN="/usr/local/bin/{{ program_name }}"
|
env RUNBIN="{{ heat_bin }}/{{ program_name }}"
|
||||||
|
|
||||||
# Change directory to service users home
|
# Change directory to service users home
|
||||||
chdir "{{ service_home }}"
|
chdir "{{ service_home }}"
|
||||||
@ -24,6 +24,11 @@ pre-start script
|
|||||||
|
|
||||||
mkdir -p "/var/lock/{{ program_name }}"
|
mkdir -p "/var/lock/{{ program_name }}"
|
||||||
chown {{ system_user }}:{{ system_group }} "/var/lock/{{ program_name }}"
|
chown {{ system_user }}:{{ system_group }} "/var/lock/{{ program_name }}"
|
||||||
|
|
||||||
|
{% if heat_venv_enabled | bool -%}
|
||||||
|
. {{ heat_venv_bin }}/activate
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# Post stop actions
|
# Post stop actions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user