diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml index 453e83e2e..fdd2a2b70 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /lib/systemd/system/ -init_ext: .service ipxe_dir: /usr/lib/ipxe/ ipxe_full_binary: ipxe.pxe ironic_rootwrap_dir: /usr/local/bin/ diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml index 81fb28052..21a7be4dd 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /usr/lib/systemd/system/ -init_ext: .service ipxe_dir: /usr/share/ipxe/ ipxe_full_binary: ipxe.lkrn ironic_rootwrap_dir: /usr/bin/ diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml index 2f7bc9144..d308c685f 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /usr/lib/systemd/system/ -init_ext: .service ipxe_dir: /usr/share/ipxe/ ipxe_full_binary: ipxe.lkrn ipxe_efi_binary: ipxe-x86_64.efi diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml index cf7903b83..ac1d88507 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /usr/lib/systemd/system/ -init_ext: .service # NOTE (cinerama): The iPXE binaries are not currently packaged for SuSE, # so we download them and install them to /usr/local/share/ipxe. If the # files are packaged, download_ipxe can be removed and ipxe_dir set to diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml index a7727718b..17b5ee2f0 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /lib/systemd/system/ -init_ext: .service required_packages: - mariadb-server - python3-dev diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index 2c5552eb4..26e969ec6 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -152,12 +152,11 @@ ironic.database.host != 'localhost' or test_created_db.changed | bool == false -- name: "Create service folder if systemd template is defined" +- name: "Create service folder" file: path: "{{ init_dest_dir }}" state: directory mode: 0755 - when: init_template == 'systemd_template.j2' - name: "Install ironic-inspector to permit use of inspection interface" include: inspector_bootstrap.yml @@ -182,8 +181,8 @@ - name: "Place ironic services on Debian family" template: - src: "{{ init_template }}" - dest: "{{ init_dest_dir }}{{ item.service_name }}{{ init_ext }}" + src: systemd_template.j2 + dest: "{{ init_dest_dir }}{{ item.service_name }}.service" owner: "root" group: "root" with_items: @@ -194,8 +193,8 @@ - name: "Place ironic services on RedHat family" template: - src: "{{ init_template }}" - dest: "{{ init_dest_dir }}{{ item.service_name }}{{ init_ext }}" + src: systemd_template.j2 + dest: "{{ init_dest_dir }}{{ item.service_name }}.service" owner: "root" group: "root" with_items: diff --git a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml index 17855c542..0d76a6456 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml @@ -95,7 +95,11 @@ register: ironic_install_prefix environment: "{{ bifrost_venv_env if enable_venv else {} }}" - name: "Inspector - Place service" - template: src={{ init_template }} dest={{ init_dest_dir }}{{item.service_name}}{{ init_ext }} owner=root group=root + template: + src: systemd_template.j2 + dest: "{{ init_dest_dir }}{{item.service_name}}.service" + owner: root + group: root with_items: - { service_path: "{{ ironic_install_prefix.stdout | default('') }}", service_name: 'ironic-inspector', username: 'ironic', args: '--config-file /etc/ironic-inspector/inspector.conf'} - name: "Inspector - Explicitly permit TCP/5050 for ironic-inspector callback" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/start.yml b/playbooks/roles/bifrost-ironic-install/tasks/start.yml index 8bfa106bb..bf0e2d5b7 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/start.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/start.yml @@ -15,7 +15,6 @@ --- - name: "Reload systemd configuration" command: systemctl daemon-reload - when: init_template == 'systemd_template.j2' - name: "Ensure rsyslog is running with current config" service: name=rsyslog state=restarted diff --git a/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 b/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 index 1b5a384f3..e9120ce44 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 @@ -7,4 +7,4 @@ User={{ item.username }} [Install] WantedBy=multi-user.target -Alias={{ item.service_name }}{{ init_ext }} +Alias={{ item.service_name }}.service diff --git a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Debian_family.yml b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Debian_family.yml index ead98a4ee..7751a4114 100644 --- a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Debian_family.yml +++ b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Debian_family.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /lib/systemd/system/ -init_ext: .service nginx_user: www-data mysql_service_name: mysql required_packages: diff --git a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_RedHat_family.yml b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_RedHat_family.yml index 341cfa7c7..92674aff7 100644 --- a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_RedHat_family.yml +++ b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_RedHat_family.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /usr/lib/systemd/system/ -init_ext: .service ipxe_dir: /usr/share/ipxe/ ipxe_full_binary: ipxe.lkrn ipxe_efi_binary: ipxe-x86_64.efi diff --git a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Suse_family.yml b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Suse_family.yml index 98240713a..06f7bc787 100644 --- a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Suse_family.yml +++ b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Suse_family.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /usr/lib/systemd/system/ -init_ext: .service mysql_service_name: mysql required_packages: - python-selinux diff --git a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Ubuntu.yml b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Ubuntu.yml index 6f2902139..09fb8af84 100644 --- a/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Ubuntu.yml +++ b/playbooks/roles/bifrost-keystone-install/defaults/required_defaults_Ubuntu.yml @@ -1,7 +1,5 @@ --- -init_template: systemd_template.j2 init_dest_dir: /lib/systemd/system/ -init_ext: .service required_packages: - mariadb-server - python3-dev diff --git a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml index ed9a82461..d26d09e70 100644 --- a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml @@ -268,8 +268,8 @@ - name: "Place uwsgi services" template: - src: "{{ init_template }}" - dest: "{{ init_dest_dir }}{{ item.service_name }}{{ init_ext }}" + src: systemd_template.j2 + dest: "{{ init_dest_dir }}{{ item.service_name }}.service" owner: "root" group: "root" with_items: diff --git a/playbooks/roles/bifrost-keystone-install/tasks/start.yml b/playbooks/roles/bifrost-keystone-install/tasks/start.yml index 3d712d196..17eddf59e 100644 --- a/playbooks/roles/bifrost-keystone-install/tasks/start.yml +++ b/playbooks/roles/bifrost-keystone-install/tasks/start.yml @@ -13,7 +13,6 @@ --- - name: "Reload systemd configuration" command: systemctl daemon-reload - when: init_template == 'systemd_template.j2' - name: "Ensure services are running with current config" service: name={{ item }} state=restarted enabled=yes diff --git a/playbooks/roles/bifrost-keystone-install/templates/systemd_template.j2 b/playbooks/roles/bifrost-keystone-install/templates/systemd_template.j2 index 7b134370e..378a2e40d 100644 --- a/playbooks/roles/bifrost-keystone-install/templates/systemd_template.j2 +++ b/playbooks/roles/bifrost-keystone-install/templates/systemd_template.j2 @@ -12,4 +12,4 @@ User={{ item.username }} [Install] WantedBy=multi-user.target -Alias={{ item.service_name }}{{ init_ext }} +Alias={{ item.service_name }}.service