Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc_salt_minion freebsd fix for rc.conf (SC-782) #1236

Merged
merged 2 commits into from Feb 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions cloudinit/config/cc_salt_minion.py
Expand Up @@ -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/
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down