Update the service settings

This commit is contained in:
Taseer Ahmed 2018-02-17 18:47:01 +05:00
parent d17b8161aa
commit ba78873d38
5 changed files with 34 additions and 20 deletions

View File

@ -26,9 +26,8 @@ blazar_venv_tag: untagged
blazar_bin: "/openstack/venvs/blazar-{{ blazar_venv_tag }}/bin"
blazar_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/blazar.tgz
blazar_etc_dir: "{{ blazar_bin | dirname }}/etc/blazar"
blazar_conf_dir: /etc/blazar
blazar_etc_dir: /etc/blazar
blazar_config_option: "--config-file {{ blazar_etc_dir }}/blazar.conf"
## Required PIP packages
blazar_requires_pip_packages:
@ -77,8 +76,11 @@ blazar_service_internaluri_proto: "{{ openstack_service_internaluri_proto | defa
blazar_service_password: password
## Service name
blazar_service_names:
- "blazar-server"
blazar_service:
blazar-api:
service_name: blazar-api
blazar-manager:
service_name: blazar-manager
## Keystone
blazar_service_project_domain_id: default

View File

@ -1,36 +1,40 @@
- name: Create TEMP run dir
file:
path: "/var/run/{{ blazar_program_name }}"
path: "/var/run/{{ item.service_name }}"
state: directory
owner: "{{ blazar_system_user_name }}"
group: "{{ blazar_system_group_name }}"
mode: "02755"
with_items: "{{ blazar_services }}"
- name: Create TEMP lock dir
file:
path: "/var/lock/{{ blazar_program_name }}"
path: "/var/lock/{{ item.service_name }}"
state: directory
owner: "{{ blazar_system_user_name }}"
group: "{{ blazar_system_group_name }}"
mode: "02755"
with_items: "{{ blazar_services }}"
- name: Create tmpfiles.d entry
template:
src: "blazar-systemd-tmpfiles.j2"
dest: "/etc/tmpfiles.d/openstack-{{ blazar_program_name }}.conf"
dest: "/etc/tmpfiles.d/openstack-{{ item.service_name }}.conf"
mode: "0644"
owner: "root"
group: "root"
with_items: "{{ blazar_services }}"
notify:
- Restart blazar services
- name: Place the systemd init script
config_template:
src: "blazar-systemd-init.j2"
dest: "/etc/systemd/system/{{ blazar_program_name }}.service"
dest: "/etc/systemd/system/{{ item.service_name }}.service"
mode: "0644"
owner: "root"
group: "root"
config_type: "ini"
with_items: "{{ blazar_services }}"
notify:
- Restart blazar services

View File

@ -7,19 +7,24 @@ After=network.target
[Service]
Type=simple
User={{ system_user }}
Group={{ system_group }}
User={{ blazar_system_user_name }}
Group={{ blazar_system_group_name }}
{% if program_override is defined %}
ExecStart={{ program_override }} {{ program_config_options|default('') }} --log-file=/var/log/blazar/{{ program_name }}.log
{% else %}
ExecStart={{ blazar_bin }}/{{ program_name }} {{ program_config_options|default('') }} --log-file=/var/log/blazar/{{ program_name }}.log
{% endif %}
ExecStart={{ blazar_bin }}/{{ item.service_name }} {{ blazar_config_option }} --log-file=/var/log/blazar/{{ item.service_name }}.log
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
Restart=on-failure
RestartSec=150
RestartSec=2
# This creates a specific slice which all services will operate from
# The accounting options give us the ability to see resource usage through
# the `systemd-cgtop` command.
Slice=blazar.slice
CPUAccounting=true
BlockIOAccounting=true
MemoryAccounting=false
TasksAccounting=true
[Install]
WantedBy=multi-user.target

View File

@ -1,4 +1,4 @@
# {{ ansible_managed }}
D /var/lock/{{ program_name }} 2755 {{ system_user }} {{ system_group }}
D /var/run/{{ program_name }} 2755 {{ system_user }} {{ system_group }}
D /var/lock/{{ item.service_name }} 2755 {{ blazar_system_user_name }} {{ blazar_system_group_name }}
D /var/run/{{ item.service_name }} 2755 {{ blazar_system_user_name }} {{ blazar_system_group_name }}

View File

@ -12,4 +12,7 @@ project_name={{ blazar_service_user_domain_id }}
user_domain_name={{ blazar_service_user_domain_id }}
username={{ blazar_service_user_name }}
password={{ blazar_service_password }}
auth_url={{ keystone_service_adminuri }}
auth_url={{ keystone_service_adminuri }}
[database]
connection = mysql+pymysql://{{ blazar_galera_user }}:{{ blazar_container_mysql_password }}@{{ blazar_galera_address }}/{{ blazar_galera_database }}?charset=utf8{% if blazar_galera_use_ssl | bool %}&ssl_ca={{ blazar_galera_ssl_ca_cert }}{% endif %}