From 2b57ae08c67ecc1f408d2fc41a9348c6d23f2f49 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 3 Feb 2022 07:49:01 -0700 Subject: [PATCH 1/2] cc_salt_minion freebsd fix for rc.conf https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254339 --- cloudinit/config/cc_salt_minion.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cloudinit/config/cc_salt_minion.py b/cloudinit/config/cc_salt_minion.py index b2e5eefdf34..df701cff3c1 100644 --- a/cloudinit/config/cc_salt_minion.py +++ b/cloudinit/config/cc_salt_minion.py @@ -46,7 +46,7 @@ import os from cloudinit import safeyaml, subp, util -from cloudinit.distros import rhel_util +from cloudinit.distros import bsd_utils # Note: see https://docs.saltstack.com/en/latest/topics/installation/ # Note: see https://docs.saltstack.com/en/latest/ref/configuration/ @@ -128,9 +128,7 @@ def handle(name, cfg, cloud, log, _args): # we need to have the salt minion service enabled in rc in order to be # able to start the service. this does only apply on FreeBSD servers. if cloud.distro.osfamily == "freebsd": - rhel_util.update_sysconfig_file( - "/etc/rc.conf", {"salt_minion_enable": "YES"} - ) + bsd_utils.set_rc_config_value("salt_minion_enable", "YES") # restart salt-minion. 'service' will start even if not started. if it # was started, it needs to be restarted for config change. From 752bcb8e9626f34be0c472177509f8b48a8fc9b2 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 3 Feb 2022 08:02:26 -0700 Subject: [PATCH 2/2] future proof package name --- cloudinit/config/cc_salt_minion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudinit/config/cc_salt_minion.py b/cloudinit/config/cc_salt_minion.py index df701cff3c1..0eb466644cd 100644 --- a/cloudinit/config/cc_salt_minion.py +++ b/cloudinit/config/cc_salt_minion.py @@ -61,7 +61,7 @@ def __init__(self, cfg): # constants tailored for FreeBSD if util.is_FreeBSD(): - self.pkg_name = "py36-salt" + self.pkg_name = "py-salt" self.srv_name = "salt_minion" self.conf_dir = "/usr/local/etc/salt" # constants for any other OS