Get install path for ironic services
Depending on the distribution, pip can install the ironic services in /usr/bin or in /usr/local/bin. Find the correct path so we can supply it to the templates for the systemd and upstart files. Change-Id: I058e6fdbe7d89249b4c9818a37ee22dafdd5d594
This commit is contained in:
parent
4c65e3d7b3
commit
e6bfd65d0f
@ -149,11 +149,14 @@
|
||||
- name: "Creating authorized_keys file for ironic user"
|
||||
command: cp -p /home/ironic/.ssh/id_rsa.pub /home/ironic/.ssh/authorized_keys
|
||||
when: testing == true
|
||||
- name: "Get ironic-api & ironic-conductor install location"
|
||||
shell: echo $(dirname $(which ironic-api))
|
||||
register: ironic_install_prefix
|
||||
- name: "Placing services"
|
||||
template: src={{ init_template }} dest={{ init_dest_dir }}{{item.service_name}}{{ init_ext }} owner=root group=root
|
||||
with_items:
|
||||
- { service_name: 'ironic-api', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
||||
- { service_name: 'ironic-conductor', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
||||
- { service_path: "{{ ironic_install_prefix.stdout }}", service_name: 'ironic-api', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
||||
- { service_path: "{{ ironic_install_prefix.stdout }}", service_name: 'ironic-conductor', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
||||
- name: "Reload systemd configuration"
|
||||
command: systemctl daemon-reload
|
||||
when: init_template == 'systemd_template.j2'
|
||||
|
@ -2,7 +2,7 @@
|
||||
Description={{ item.service_name }} service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/{{ item.service_name }} {{ item.args }}
|
||||
ExecStart={{ item.service_path }}/{{ item.service_name }} {{ item.args }}
|
||||
User={{ item.username }}
|
||||
|
||||
[Install]
|
||||
|
@ -7,4 +7,4 @@ end script
|
||||
respawn
|
||||
respawn limit 2 10
|
||||
|
||||
exec start-stop-daemon --start -c {{ item.username }} --exec /usr/local/bin/{{ item.service_name }} -- {{ item.args }}
|
||||
exec start-stop-daemon --start -c {{ item.username }} --exec {{ item.service_path }}/{{ item.service_name }} -- {{ item.args }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user