Merge "Get install path for ironic services"

This commit is contained in:
Jenkins 2015-09-01 02:52:58 +00:00 committed by Gerrit Code Review
commit 2bb8aee343
3 changed files with 7 additions and 4 deletions

View File

@ -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'

View File

@ -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]

View File

@ -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 }}