From 348eec834fafdb77d3c8b17ace7cb6bd6fbc7004 Mon Sep 17 00:00:00 2001 From: Ivan Suzdal Date: Tue, 21 Jun 2016 18:21:57 +0300 Subject: [PATCH] Add systemctl support for runcmd Also for now enabled/disabled actions is identic for both puppet and mcollective Change-Id: I818faeb38348bd1c09eec44b194ce3f665f09e96 --- .../cloud_config_ubuntu.jinja2 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cloud-init-templates/cloud_config_ubuntu.jinja2 b/cloud-init-templates/cloud_config_ubuntu.jinja2 index 835dbcdf..ab39d029 100644 --- a/cloud-init-templates/cloud_config_ubuntu.jinja2 +++ b/cloud-init-templates/cloud_config_ubuntu.jinja2 @@ -105,14 +105,37 @@ puppet: runcmd: {% if puppet.enable != 1 %} + - if [ -x /bin/systemctl ]; then + - /bin/systemctl stop puppet + - /bin/systemctl disable puppet + - else - /usr/sbin/invoke-rc.d puppet stop - /usr/sbin/update-rc.d -f puppet remove + - echo manual > /etc/init/puppet.override + - fi +{% else %} + - if [ -x /bin/systemctl ]; then + - /bin/systemctl enable puppet + - else + - rm -f /etc/init/puppet.override + - fi {% endif %} {% if mcollective.enable != 1 %} + - if [ -x /bin/systemctl ]; then + - /bin/systemctl stop mcollective + - /bin/systemctl disable mcollective + - else - /usr/sbin/invoke-rc.d mcollective stop + - /usr/sbin/update-rc.d -f mcollective remove - echo manual > /etc/init/mcollective.override + - fi {% else %} + - if [ -x /bin/systemctl ]; then + - /bin/systemctl unmask mcollective + - /bin/systemctl enable mcollective + - else - rm -f /etc/init/mcollective.override + - fi {% endif %} - iptables -t filter -F INPUT - iptables -t filter -F FORWARD