Merge "Implement glance venv support"
This commit is contained in:
commit
62d5bf6c1a
@ -86,7 +86,11 @@
|
|||||||
tags:
|
tags:
|
||||||
- glance-logs
|
- glance-logs
|
||||||
roles:
|
roles:
|
||||||
- { role: "os_glance", tags: [ "os-glance" ] }
|
- role: "os_glance"
|
||||||
|
glance_galera_address: "{{ galera_address }}"
|
||||||
|
glance_venv_tag: "{{ openstack_release }}"
|
||||||
|
tags:
|
||||||
|
- "os-glance"
|
||||||
- { role: "openstack_openrc", tags: [ "openstack-openrc" ] }
|
- { role: "openstack_openrc", tags: [ "openstack-openrc" ] }
|
||||||
- role: "ceph_client"
|
- role: "ceph_client"
|
||||||
openstack_service_system_user: "{{ glance_system_user_name }}"
|
openstack_service_system_user: "{{ glance_system_user_name }}"
|
||||||
@ -105,6 +109,5 @@
|
|||||||
- "system-crontab-coordination"
|
- "system-crontab-coordination"
|
||||||
vars:
|
vars:
|
||||||
galera_address: "{{ internal_lb_vip_address }}"
|
galera_address: "{{ internal_lb_vip_address }}"
|
||||||
glance_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) }}"
|
||||||
|
@ -13,15 +13,25 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# Defines that the role will be deployed on a host machine
|
## Verbosity Options
|
||||||
is_metal: true
|
debug: False
|
||||||
|
verbose: True
|
||||||
|
|
||||||
|
# Name of the virtual env to deploy into
|
||||||
|
glance_venv_tag: untagged
|
||||||
|
glance_venv_bin: "/openstack/venvs/glance-{{ glance_venv_tag }}/bin"
|
||||||
|
|
||||||
|
# Set this to enable or disable installing in a venv
|
||||||
|
glance_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.
|
||||||
|
glance_bin: "{{ glance_venv_bin }}"
|
||||||
|
|
||||||
# Enable/Disable Ceilometer
|
# Enable/Disable Ceilometer
|
||||||
glance_ceilometer_enabled: False
|
glance_ceilometer_enabled: False
|
||||||
|
|
||||||
## Verbosity Options
|
|
||||||
debug: False
|
|
||||||
verbose: True
|
|
||||||
glance_profiler_enabled: False
|
glance_profiler_enabled: False
|
||||||
glance_fatal_deprecations: False
|
glance_fatal_deprecations: False
|
||||||
|
|
||||||
@ -154,6 +164,11 @@ glance_apt_packages:
|
|||||||
- git
|
- git
|
||||||
- nfs-common
|
- nfs-common
|
||||||
|
|
||||||
|
# Cinder packages that must be installed before anything else
|
||||||
|
glance_requires_pip_packages:
|
||||||
|
- virtualenv
|
||||||
|
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
|
||||||
|
|
||||||
# Common pip packages
|
# Common pip packages
|
||||||
glance_pip_packages:
|
glance_pip_packages:
|
||||||
- glance
|
- glance
|
||||||
|
@ -40,9 +40,10 @@
|
|||||||
- glance-db-setup
|
- glance-db-setup
|
||||||
|
|
||||||
- name: Perform a Glance DB sync
|
- name: Perform a Glance DB sync
|
||||||
command: glance-manage db_sync
|
command: "{{ glance_bin }}/glance-manage db_sync"
|
||||||
sudo: yes
|
sudo: yes
|
||||||
sudo_user: "{{ glance_system_user_name }}"
|
sudo_user: "{{ glance_system_user_name }}"
|
||||||
tags:
|
tags:
|
||||||
- glance-db-sync
|
- glance-db-sync
|
||||||
- glance-setup
|
- glance-setup
|
||||||
|
- glance-command-bin
|
||||||
|
@ -37,7 +37,40 @@
|
|||||||
- glance-install
|
- glance-install
|
||||||
- glance-apt-packages
|
- glance-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:
|
||||||
|
- "{{ glance_requires_pip_packages }}"
|
||||||
|
tags:
|
||||||
|
- glance-install
|
||||||
|
- glance-pip-packages
|
||||||
|
|
||||||
|
- name: Install pip packages (venv)
|
||||||
|
pip:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
virtualenv: "{{ glance_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:
|
||||||
|
- "{{ glance_pip_packages }}"
|
||||||
|
when: glance_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- glance-install
|
||||||
|
- glance-pip-packages
|
||||||
|
|
||||||
|
- name: Install pip packages (no venv)
|
||||||
pip:
|
pip:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
@ -48,6 +81,7 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ glance_pip_packages }}"
|
- "{{ glance_pip_packages }}"
|
||||||
|
when: not glance_venv_enabled | bool
|
||||||
tags:
|
tags:
|
||||||
- glance-install
|
- glance-install
|
||||||
- glance-pip-packages
|
- glance-pip-packages
|
||||||
|
@ -13,25 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Create glance cache management cron jobs
|
|
||||||
cron:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
minute: "{{ 59 |random(start=1) }}"
|
|
||||||
day: "*"
|
|
||||||
hour: "{{ item.hour }}"
|
|
||||||
month: "*"
|
|
||||||
state: present
|
|
||||||
job: "{{ item.name }}"
|
|
||||||
user: glance
|
|
||||||
with_items:
|
|
||||||
- name: /usr/local/bin/glance-cache-pruner
|
|
||||||
hour: "*"
|
|
||||||
- name: /usr/local/bin/glance-cache-cleaner
|
|
||||||
hour: "*/5"
|
|
||||||
when: glance_flavor | search("cache")
|
|
||||||
tags:
|
|
||||||
- glance-cron
|
|
||||||
|
|
||||||
- name: Drop Glance Config(s)
|
- name: Drop Glance Config(s)
|
||||||
config_template:
|
config_template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
@ -112,3 +93,38 @@
|
|||||||
tags:
|
tags:
|
||||||
- glance-nfs
|
- glance-nfs
|
||||||
- glance-nfs-local-path
|
- glance-nfs-local-path
|
||||||
|
|
||||||
|
- name: Get glance command path
|
||||||
|
command: which glance
|
||||||
|
register: glance_command_path
|
||||||
|
when:
|
||||||
|
- not glance_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- glance-command-bin
|
||||||
|
|
||||||
|
- name: Set glance command path
|
||||||
|
set_fact:
|
||||||
|
glance_bin: "{{ glance_command_path.stdout | dirname }}"
|
||||||
|
when:
|
||||||
|
- not glance_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- glance-command-bin
|
||||||
|
|
||||||
|
- name: Create glance cache management cron jobs
|
||||||
|
cron:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
minute: "{{ 59 |random(start=1) }}"
|
||||||
|
day: "*"
|
||||||
|
hour: "{{ item.hour }}"
|
||||||
|
month: "*"
|
||||||
|
state: present
|
||||||
|
job: "{{ item.name }}"
|
||||||
|
user: glance
|
||||||
|
with_items:
|
||||||
|
- name: "{{ glance_bin }}/glance-cache-pruner"
|
||||||
|
hour: "*"
|
||||||
|
- name: "{{ glance_bin }}/glance-cache-cleaner"
|
||||||
|
hour: "*/5"
|
||||||
|
when: glance_flavor | search("cache")
|
||||||
|
tags:
|
||||||
|
- glance-cron
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
group: "{{ item.group|default(glance_system_group_name) }}"
|
group: "{{ item.group|default(glance_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/glance" }
|
- { path: "/etc/glance" }
|
||||||
- { path: "/etc/sudoers.d", mode: "0755", owner: "root", group: "root" }
|
- { path: "/etc/sudoers.d", mode: "0755", owner: "root", group: "root" }
|
||||||
- { path: "/var/cache/glance" }
|
- { path: "/var/cache/glance" }
|
||||||
@ -52,6 +53,17 @@
|
|||||||
tags:
|
tags:
|
||||||
- glance-dirs
|
- glance-dirs
|
||||||
|
|
||||||
|
- name: Create glance venv dir
|
||||||
|
file:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- { path: "/openstack/venvs" }
|
||||||
|
- { path: "{{ glance_venv_bin }}" }
|
||||||
|
when: glance_venv_enabled | bool
|
||||||
|
tags:
|
||||||
|
- glance-dirs
|
||||||
|
|
||||||
- name: Test for log directory or link
|
- name: Test for log directory or link
|
||||||
shell: |
|
shell: |
|
||||||
if [ -h "/var/log/glance" ]; then
|
if [ -h "/var/log/glance" ]; then
|
||||||
|
@ -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="{{ glance_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 glance_venv_enabled | bool -%}
|
||||||
|
. {{ glance_venv_bin }}/activate
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# Post stop actions
|
# Post stop actions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user