How to Install SaltStack Minion on CentOS 8 - CentLinux

Latest

Sunday, 16 August 2020

How to Install SaltStack Minion on CentOS 8

How to Install SaltStack Minion on CentOS 8

This article will guide you about how to install SaltStack minion on CentOS 8.

 

Table of Contents:

     

    What is SaltStack Minion?:

    SaltStack or Salt is a Python-based, open-source software for event based IT automation, remote task execution, and configuration management. SaltStack supports "Infrastructure as Code" approach to data center system and network deployment and management, configuration automation, SecOps orchestration, vulnerability remediation, and hybrid cloud control. (Courtesy: Wikipedia)

    SaltStack minion is the agent software that is installed on the managed node and it is used to execute commands on that node and report back to SaltStack master server.

     

    Environment Specification:

    We are using a minimal CentOS 8 virtual machine with following specification.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 20 GB
    • Operating System - CentOS 8.2
    • Hostname – saltstack-minion-01.centlinux.com
    • IP Address - 192.168.116.228 /24

     

    Update CentOS 8 Software Packages:

    Connect with saltstack-minion-01.centlinux.com as root user by using a ssh tool.

    It is a best practice to update software packages on CentOS 8 before installing anything new. Therefore, execute following dnf command to update all CentOS 8 software packages.

    [root@saltstack-minion-01 ~]# dnf update -y ... Upgraded: NetworkManager-1:1.22.8-5.el8_2.x86_64 NetworkManager-libnm-1:1.22.8-5.el8_2.x86_64 NetworkManager-team-1:1.22.8-5.el8_2.x86_64 NetworkManager-tui-1:1.22.8-5.el8_2.x86_64 bind-export-libs-32:9.11.13-5.el8_2.x86_64 dbus-1:1.12.8-10.el8_2.x86_64 dbus-common-1:1.12.8-10.el8_2.noarch dbus-daemon-1:1.12.8-10.el8_2.x86_64 dbus-libs-1:1.12.8-10.el8_2.x86_64 dbus-tools-1:1.12.8-10.el8_2.x86_64 dnf-4.2.17-7.el8_2.noarch dnf-data-4.2.17-7.el8_2.noarch gnutls-3.6.8-11.el8_2.x86_64 grub2-common-1:2.02-87.el8_2.noarch grub2-pc-1:2.02-87.el8_2.x86_64 grub2-pc-modules-1:2.02-87.el8_2.noarch grub2-tools-1:2.02-87.el8_2.x86_64 grub2-tools-efi-1:2.02-87.el8_2.x86_64 grub2-tools-extra-1:2.02-87.el8_2.x86_64 grub2-tools-minimal-1:2.02-87.el8_2.x86_64 iptables-1.8.4-10.el8_2.1.x86_64 iptables-ebtables-1.8.4-10.el8_2.1.x86_64 iptables-libs-1.8.4-10.el8_2.1.x86_64 kernel-tools-4.18.0-193.14.2.el8_2.x86_64 kernel-tools-libs-4.18.0-193.14.2.el8_2.x86_64 libdnf-0.39.1-6.el8_2.x86_64 libnghttp2-1.33.0-3.el8_2.1.x86_64 microcode_ctl-4:20191115-4.20200609.1.el8_2.x86_64 open-vm-tools-11.0.5-3.el8.x86_64 python3-dnf-4.2.17-7.el8_2.noarch python3-hawkey-0.39.1-6.el8_2.x86_64 python3-libdnf-0.39.1-6.el8_2.x86_64 python3-perf-4.18.0-193.14.2.el8_2.x86_64 selinux-policy-3.14.3-41.el8_2.5.noarch selinux-policy-targeted-3.14.3-41.el8_2.5.noarch systemd-239-31.el8_2.2.x86_64 systemd-libs-239-31.el8_2.2.x86_64 systemd-pam-239-31.el8_2.2.x86_64 systemd-udev-239-31.el8_2.2.x86_64 yum-4.2.17-7.el8_2.noarch Installed: kernel-4.18.0-193.14.2.el8_2.x86_64 kernel-core-4.18.0-193.14.2.el8_2.x86_64 kernel-modules-4.18.0-193.14.2.el8_2.x86_64 Removed: kernel-4.18.0-147.5.1.el8_1.x86_64 kernel-core-4.18.0-147.5.1.el8_1.x86_64 kernel-modules-4.18.0-147.5.1.el8_1.x86_64 Complete!

     

    Installing Python on CentOS 8:

    SaltStack is Python-based software, therefore it requires Python language support to compile and execute SaltStack commands.

    Python 3.6 is available in default CentOS 8 AppStream, therefore, we can easily install it by using dnf command.

    [root@saltstack-minion-01 ~]# dnf install -y python3 Last metadata expiration check: 0:13:43 ago on Tue 11 Aug 2020 11:59:50 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repo Size ================================================================================ Installing: python36 x86_64 3.6.8-2.module_el8.1.0+245+c39af44f AppStream 19 k Installing dependencies: python3-pip noarch 9.0.3-16.el8 AppStream 19 k python3-setuptools noarch 39.2.0-5.el8 BaseOS 162 k Enabling module streams: python36 3.6 Transaction Summary ================================================================================ Install 3 Packages Total download size: 201 k Installed size: 466 k Downloading Packages: (1/3): python3-setuptools-39.2.0-5.el8.noarch.r 553 kB/s | 162 kB 00:00 (2/3): python3-pip-9.0.3-16.el8.noarch.rpm 50 kB/s | 19 kB 00:00 (3/3): python36-3.6.8-2.module_el8.1.0+245+c39a 38 kB/s | 19 kB 00:00 -------------------------------------------------------------------------------- Total 121 kB/s | 201 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-setuptools-39.2.0-5.el8.noarch 1/3 Installing : python36-3.6.8-2.module_el8.1.0+245+c39af44f.x86_64 2/3 Running scriptlet: python36-3.6.8-2.module_el8.1.0+245+c39af44f.x86_64 2/3 Installing : python3-pip-9.0.3-16.el8.noarch 3/3 Running scriptlet: python3-pip-9.0.3-16.el8.noarch 3/3 Verifying : python3-pip-9.0.3-16.el8.noarch 1/3 Verifying : python36-3.6.8-2.module_el8.1.0+245+c39af44f.x86_64 2/3 Verifying : python3-setuptools-39.2.0-5.el8.noarch 3/3 Installed: python3-pip-9.0.3-16.el8.noarch python3-setuptools-39.2.0-5.el8.noarch python36-3.6.8-2.module_el8.1.0+245+c39af44f.x86_64 Complete!

     

    Installing SaltStack Official Yum Repository on CentOS 8:

    Although SaltStack software packages are available via EPEL (Extra Packages for Enterprise Linux) yum repository. But if you want to install the latest version of SaltStack packages then you have to install SaltStack official yum repository as follows.

    [root@saltstack-minion-01 ~]# dnf install -y https://repo.saltstack.com/py3/redhat/salt-py3-repo-latest.el8.noarch.rpm Last metadata expiration check: 0:14:14 ago on Tue 11 Aug 2020 11:59:50 PM PKT. salt-py3-repo-latest.el8.noarch.rpm 11 kB/s | 8.9 kB 00:00 Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: salt-py3-repo noarch latest-4.el8 @commandline 8.9 k Transaction Summary ================================================================================ Install 1 Package Total size: 8.9 k Installed size: 2.0 k Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : salt-py3-repo-latest-4.el8.noarch 1/1 Verifying : salt-py3-repo-latest-4.el8.noarch 1/1 Installed: salt-py3-repo-latest-4.el8.noarch Complete!

    Build cache for newly installed yum repositories.

    [root@saltstack-minion-01 ~]# dnf makecache CentOS-8 - AppStream 5.1 kB/s | 4.3 kB 00:00 CentOS-8 - Base 8.8 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 2.2 kB/s | 1.5 kB 00:00 SaltStack Latest Release Channel Python 3 for R 132 kB/s | 224 kB 00:01 Metadata cache created.

     

    Installing SaltStack Minion on CentOS 8:

    We have added SaltStack official yum repository, now we can install SaltStack packages by using the dnf command.

    [root@saltstack-minion-01 ~]# dnf install -y salt-minion Last metadata expiration check: 0:00:39 ago on Wed 12 Aug 2020 12:14:36 AM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: salt-minion noarch 3001.1-1.el8 salt-py3-latest 43 k Installing dependencies: libsodium x86_64 1.0.17-2.el8 salt-py3-latest 158 k libunwind x86_64 1.3.1-2.el8 salt-py3-latest 74 k openpgm x86_64 5.2.122-17.el8 salt-py3-latest 179 k python3-babel noarch 2.5.1-5.el8 AppStream 4.8 M python3-chardet noarch 3.0.4-7.el8 BaseOS 195 k python3-distro noarch 1.4.0-2.module_el8.1.0+245+c39af44f AppStream 37 k python3-jinja2 noarch 2.10.1-2.el8_0 AppStream 538 k python3-m2crypto x86_64 0.33.0-1.el8 salt-py3-latest 302 k python3-markupsafe x86_64 0.23-19.el8 AppStream 39 k python3-msgpack x86_64 0.6.1-3.el8 salt-py3-latest 91 k python3-psutil x86_64 5.4.3-10.el8 AppStream 373 k python3-pycurl x86_64 7.43.0.2-4.el8 AppStream 227 k python3-pysocks noarch 1.6.8-3.el8 BaseOS 34 k python3-pytz noarch 2017.2-9.el8 AppStream 54 k python3-pyyaml x86_64 3.12-12.el8 BaseOS 193 k python3-requests noarch 2.20.0-2.1.el8_1 BaseOS 123 k python3-typing noarch 3.5.2.2-4.el8 salt-py3-latest 44 k python3-urllib3 noarch 1.24.2-4.el8 BaseOS 176 k python3-zmq x86_64 17.0.0-5.el8 salt-py3-latest 399 k salt noarch 3001.1-1.el8 salt-py3-latest 10 M zeromq x86_64 4.3.1-4.el8 salt-py3-latest 297 k Transaction Summary ================================================================================ Install 22 Packages Total download size: 19 M Installed size: 79 M Downloading Packages: (1/22): python3-distro-1.4.0-2.module_el8.1.0+2 43 kB/s | 37 kB 00:00 (2/22): python3-markupsafe-0.23-19.el8.x86_64.r 63 kB/s | 39 kB 00:00 (3/22): python3-jinja2-2.10.1-2.el8_0.noarch.rp 255 kB/s | 538 kB 00:02 (4/22): python3-pycurl-7.43.0.2-4.el8.x86_64.rp 291 kB/s | 227 kB 00:00 (5/22): python3-pytz-2017.2-9.el8.noarch.rpm 136 kB/s | 54 kB 00:00 (6/22): python3-psutil-5.4.3-10.el8.x86_64.rpm 196 kB/s | 373 kB 00:01 (7/22): python3-pysocks-1.6.8-3.el8.noarch.rpm 91 kB/s | 34 kB 00:00 (8/22): python3-chardet-3.0.4-7.el8.noarch.rpm 157 kB/s | 195 kB 00:01 (9/22): python3-pyyaml-3.12-12.el8.x86_64.rpm 164 kB/s | 193 kB 00:01 (10/22): python3-requests-2.20.0-2.1.el8_1.noar 244 kB/s | 123 kB 00:00 (11/22): python3-urllib3-1.24.2-4.el8.noarch.rp 196 kB/s | 176 kB 00:00 (12/22): libunwind-1.3.1-2.el8.x86_64.rpm 49 kB/s | 74 kB 00:01 (13/22): libsodium-1.0.17-2.el8.x86_64.rpm 58 kB/s | 158 kB 00:02 (14/22): openpgm-5.2.122-17.el8.x86_64.rpm 279 kB/s | 179 kB 00:00 (15/22): python3-msgpack-0.6.1-3.el8.x86_64.rpm 105 kB/s | 91 kB 00:00 (16/22): python3-typing-3.5.2.2-4.el8.noarch.rp 36 kB/s | 44 kB 00:01 (17/22): python3-m2crypto-0.33.0-1.el8.x86_64.r 121 kB/s | 302 kB 00:02 (18/22): python3-babel-2.5.1-5.el8.noarch.rpm 459 kB/s | 4.8 MB 00:10 (19/22): salt-minion-3001.1-1.el8.noarch.rpm 43 kB/s | 43 kB 00:00 (20/22): python3-zmq-17.0.0-5.el8.x86_64.rpm 197 kB/s | 399 kB 00:02 (21/22): zeromq-4.3.1-4.el8.x86_64.rpm 145 kB/s | 297 kB 00:02 (22/22): salt-3001.1-1.el8.noarch.rpm 602 kB/s | 10 MB 00:17 -------------------------------------------------------------------------------- Total 660 kB/s | 19 MB 00:29 warning: /var/cache/dnf/salt-py3-latest-ab32c742cbd8c211/packages/libsodium-1.0.17-2.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID de57bfbe: NOKEY SaltStack Latest Release Channel Python 3 for R 1.7 MB/s | 1.7 kB 00:00 Importing GPG key 0xDE57BFBE: Userid : "SaltStack Packaging Team <packaging@saltstack.com>" Fingerprint: 754A 1A7A E731 F165 D5E6 D4BD 0E08 A149 DE57 BFBE From : /etc/pki/rpm-gpg/saltstack-signing-key Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-markupsafe-0.23-19.el8.x86_64 1/22 Installing : python3-typing-3.5.2.2-4.el8.noarch 2/22 Installing : python3-m2crypto-0.33.0-1.el8.x86_64 3/22 Installing : python3-msgpack-0.6.1-3.el8.x86_64 4/22 Installing : openpgm-5.2.122-17.el8.x86_64 5/22 Installing : libunwind-1.3.1-2.el8.x86_64 6/22 Installing : libsodium-1.0.17-2.el8.x86_64 7/22 Installing : zeromq-4.3.1-4.el8.x86_64 8/22 Installing : python3-zmq-17.0.0-5.el8.x86_64 9/22 Installing : python3-pyyaml-3.12-12.el8.x86_64 10/22 Installing : python3-pysocks-1.6.8-3.el8.noarch 11/22 Installing : python3-urllib3-1.24.2-4.el8.noarch 12/22 Installing : python3-chardet-3.0.4-7.el8.noarch 13/22 Installing : python3-requests-2.20.0-2.1.el8_1.noarch 14/22 Installing : python3-pytz-2017.2-9.el8.noarch 15/22 Installing : python3-babel-2.5.1-5.el8.noarch 16/22 Installing : python3-jinja2-2.10.1-2.el8_0.noarch 17/22 Installing : python3-pycurl-7.43.0.2-4.el8.x86_64 18/22 Installing : python3-psutil-5.4.3-10.el8.x86_64 19/22 Installing : python3-distro-1.4.0-2.module_el8.1.0+245+c39af44f 20/22 Installing : salt-3001.1-1.el8.noarch 21/22 Installing : salt-minion-3001.1-1.el8.noarch 22/22 Running scriptlet: salt-minion-3001.1-1.el8.noarch 22/22 Verifying : python3-babel-2.5.1-5.el8.noarch 1/22 Verifying : python3-distro-1.4.0-2.module_el8.1.0+245+c39af44f 2/22 Verifying : python3-jinja2-2.10.1-2.el8_0.noarch 3/22 Verifying : python3-markupsafe-0.23-19.el8.x86_64 4/22 Verifying : python3-psutil-5.4.3-10.el8.x86_64 5/22 Verifying : python3-pycurl-7.43.0.2-4.el8.x86_64 6/22 Verifying : python3-pytz-2017.2-9.el8.noarch 7/22 Verifying : python3-chardet-3.0.4-7.el8.noarch 8/22 Verifying : python3-pysocks-1.6.8-3.el8.noarch 9/22 Verifying : python3-pyyaml-3.12-12.el8.x86_64 10/22 Verifying : python3-requests-2.20.0-2.1.el8_1.noarch 11/22 Verifying : python3-urllib3-1.24.2-4.el8.noarch 12/22 Verifying : libsodium-1.0.17-2.el8.x86_64 13/22 Verifying : libunwind-1.3.1-2.el8.x86_64 14/22 Verifying : openpgm-5.2.122-17.el8.x86_64 15/22 Verifying : python3-m2crypto-0.33.0-1.el8.x86_64 16/22 Verifying : python3-msgpack-0.6.1-3.el8.x86_64 17/22 Verifying : python3-typing-3.5.2.2-4.el8.noarch 18/22 Verifying : python3-zmq-17.0.0-5.el8.x86_64 19/22 Verifying : salt-3001.1-1.el8.noarch 20/22 Verifying : salt-minion-3001.1-1.el8.noarch 21/22 Verifying : zeromq-4.3.1-4.el8.x86_64 22/22 Installed: libsodium-1.0.17-2.el8.x86_64 libunwind-1.3.1-2.el8.x86_64 openpgm-5.2.122-17.el8.x86_64 python3-babel-2.5.1-5.el8.noarch python3-chardet-3.0.4-7.el8.noarch python3-distro-1.4.0-2.module_el8.1.0+245+c39af44f.noarch python3-jinja2-2.10.1-2.el8_0.noarch python3-m2crypto-0.33.0-1.el8.x86_64 python3-markupsafe-0.23-19.el8.x86_64 python3-msgpack-0.6.1-3.el8.x86_64 python3-psutil-5.4.3-10.el8.x86_64 python3-pycurl-7.43.0.2-4.el8.x86_64 python3-pysocks-1.6.8-3.el8.noarch python3-pytz-2017.2-9.el8.noarch python3-pyyaml-3.12-12.el8.x86_64 python3-requests-2.20.0-2.1.el8_1.noarch python3-typing-3.5.2.2-4.el8.noarch python3-urllib3-1.24.2-4.el8.noarch python3-zmq-17.0.0-5.el8.x86_64 salt-3001.1-1.el8.noarch salt-minion-3001.1-1.el8.noarch zeromq-4.3.1-4.el8.x86_64 Complete!

     

    Configure SaltStack Minion on CentOS 8:

    Default configurations of SaltStack minion works fine, except that we need to tell the Minion about the SaltStack Master server.

    Therefore, edit SaltStack minion configuration file by using vim editor.

    [root@saltstack-minion-01 ~]# vi /etc/salt/minion

    Locate following directive therein.

    #master: salt

    and replace the above directive with the following directive.

    master: saltstack-master-01.centlinux.com

    Where saltstack-master-01.centlinux.com is the SaltStack Master server that we have configured in our previous article. Please refer to How to install SaltStack Master on CentOS 8.

    Enable and start salt-minion service.

    [root@saltstack-minion-01 ~]# systemctl enable --now salt-minion Created symlink /etc/systemd/system/multi-user.target.wants/salt-minion.service รข /usr/lib/systemd/system/salt-minion.service.

     

    Add SaltStack Minion in SaltStack Master Server:

    Connect with saltstack-master-01.centlinux.com as root user by using PuTTY.

    Display list of all public keys known to SaltStack master server.

    [root@saltstack-master-01 ~]# salt-key -L Accepted Keys: saltstack-master-01.centlinux.com Denied Keys: Unaccepted Keys: saltstack-minion-01.centlinux.com Rejected Keys:

    You can see that, there is one unaccepted key i.e. saltstack-minion-01.centlinux.com. It is the public key of our SaltStack minion.

    Accept this key by using following command.

    [root@saltstack-master-01 ~]# salt-key -A The following keys are going to be accepted: Unaccepted Keys: saltstack-minion-01.centlinux.com Proceed? [n/Y] Y Key for minion saltstack-minion-01.centlinux.com accepted.

     

    Remote Execution of commands on SaltStack Minion:

    Our Minion has been added in SaltStack Master inventory. we can now execute commands on this minion.

    For demonstration, we are remotely installing Apache web server on saltstack-minion-01.centlinux.com.

    [root@saltstack-master-01 ~]# salt 'saltstack-minion-01.centlinux.com' cmd.run 'dnf install -y httpd' saltstack-minion-01.centlinux.com: Last metadata expiration check: 0:08:56 ago on Wed Aug 12 00:14:36 2020. Dependencies resolved. ================================================================================ Package Arch Version Repo Size ================================================================================ Installing: httpd x86_64 2.4.37-21.module_el8.2.0+382+15b0afa8 AppStream 1.7 M Installing dependencies: apr x86_64 1.6.3-9.el8 AppStream 125 k apr-util x86_64 1.6.1-6.el8 AppStream 105 k centos-logos-httpd noarch 80.5-2.el8 BaseOS 24 k httpd-filesystem noarch 2.4.37-21.module_el8.2.0+382+15b0afa8 AppStream 36 k httpd-tools x86_64 2.4.37-21.module_el8.2.0+382+15b0afa8 AppStream 103 k mailcap noarch 2.1.48-3.el8 BaseOS 39 k mod_http2 x86_64 1.11.3-3.module_el8.2.0+307+4d18d695 AppStream 157 k Installing weak dependencies: apr-util-bdb x86_64 1.6.1-6.el8 AppStream 25 k apr-util-openssl x86_64 1.6.1-6.el8 AppStream 27 k Enabling module streams: httpd 2.4 Transaction Summary ================================================================================ Install 10 Packages Total download size: 2.3 M Installed size: 6.1 M Downloading Packages: (1/10): apr-util-bdb-1.6.1-6.el8.x86_64.rpm 90 kB/s | 25 kB 00:00 (2/10): apr-util-openssl-1.6.1-6.el8.x86_64.rpm 175 kB/s | 27 kB 00:00 (3/10): apr-1.6.3-9.el8.x86_64.rpm 199 kB/s | 125 kB 00:00 (4/10): apr-util-1.6.1-6.el8.x86_64.rpm 165 kB/s | 105 kB 00:00 (5/10): httpd-filesystem-2.4.37-21.module_el8.2 118 kB/s | 36 kB 00:00 (6/10): httpd-tools-2.4.37-21.module_el8.2.0+38 172 kB/s | 103 kB 00:00 (7/10): mod_http2-1.11.3-3.module_el8.2.0+307+4 197 kB/s | 157 kB 00:00 (8/10): centos-logos-httpd-80.5-2.el8.noarch.rp 37 kB/s | 24 kB 00:00 (9/10): mailcap-2.1.48-3.el8.noarch.rpm 72 kB/s | 39 kB 00:00 (10/10): httpd-2.4.37-21.module_el8.2.0+382+15b 512 kB/s | 1.7 MB 00:03 -------------------------------------------------------------------------------- Total 486 kB/s | 2.3 MB 00:04 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : apr-1.6.3-9.el8.x86_64 1/10 Running scriptlet: apr-1.6.3-9.el8.x86_64 1/10 Installing : apr-util-bdb-1.6.1-6.el8.x86_64 2/10 Installing : apr-util-openssl-1.6.1-6.el8.x86_64 3/10 Installing : apr-util-1.6.1-6.el8.x86_64 4/10 Running scriptlet: apr-util-1.6.1-6.el8.x86_64 4/10 Installing : httpd-tools-2.4.37-21.module_el8.2.0+382+15b0afa8. 5/10 Installing : mailcap-2.1.48-3.el8.noarch 6/10 Installing : centos-logos-httpd-80.5-2.el8.noarch 7/10 Running scriptlet: httpd-filesystem-2.4.37-21.module_el8.2.0+382+15b0 8/10 Installing : httpd-filesystem-2.4.37-21.module_el8.2.0+382+15b0 8/10 Installing : mod_http2-1.11.3-3.module_el8.2.0+307+4d18d695.x86 9/10 Installing : httpd-2.4.37-21.module_el8.2.0+382+15b0afa8.x86_64 10/10 Running scriptlet: httpd-2.4.37-21.module_el8.2.0+382+15b0afa8.x86_64 10/10 Verifying : apr-1.6.3-9.el8.x86_64 1/10 Verifying : apr-util-1.6.1-6.el8.x86_64 2/10 Verifying : apr-util-bdb-1.6.1-6.el8.x86_64 3/10 Verifying : apr-util-openssl-1.6.1-6.el8.x86_64 4/10 Verifying : httpd-2.4.37-21.module_el8.2.0+382+15b0afa8.x86_64 5/10 Verifying : httpd-filesystem-2.4.37-21.module_el8.2.0+382+15b0 6/10 Verifying : httpd-tools-2.4.37-21.module_el8.2.0+382+15b0afa8. 7/10 Verifying : mod_http2-1.11.3-3.module_el8.2.0+307+4d18d695.x86 8/10 Verifying : centos-logos-httpd-80.5-2.el8.noarch 9/10 Verifying : mailcap-2.1.48-3.el8.noarch 10/10 Installed: apr-1.6.3-9.el8.x86_64 apr-util-1.6.1-6.el8.x86_64 apr-util-bdb-1.6.1-6.el8.x86_64 apr-util-openssl-1.6.1-6.el8.x86_64 centos-logos-httpd-80.5-2.el8.noarch httpd-2.4.37-21.module_el8.2.0+382+15b0afa8.x86_64 httpd-filesystem-2.4.37-21.module_el8.2.0+382+15b0afa8.noarch httpd-tools-2.4.37-21.module_el8.2.0+382+15b0afa8.x86_64 mailcap-2.1.48-3.el8.noarch mod_http2-1.11.3-3.module_el8.2.0+307+4d18d695.x86_64 Complete!

    Enable and start Apache service on saltstack-minion-01.

    [root@saltstack-master-01 ~]# salt 'saltstack-minion-01.centlinux.com' cmd.run 'systemctl enable --now httpd.service' saltstack-minion-01.centlinux.com: Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service -> /usr/lib/systemd/system/httpd.service.

    Allow http service in Linux firewall on saltstack-minion-01.

    [root@saltstack-master-01 ~]# salt 'saltstack-minion-01.centlinux.com' cmd.run 'firewall-cmd --add-service=http' saltstack-minion-01.centlinux.com: success

    Now, access the newly configured web server by using curl command.

    [root@saltstack-master-01 ~]# curl -I http://saltstack-minion-01.centlinux.com HTTP/1.1 403 Forbidden Date: Tue, 11 Aug 2020 19:25:57 GMT Server: Apache/2.4.37 (centos) Content-Location: index.html.zh-CN Vary: negotiate,accept-language TCN: choice Last-Modified: Fri, 14 Jun 2019 03:37:43 GMT ETag: "fa6-58b405e7d6fc0;5ac9f026acb21" Accept-Ranges: bytes Content-Length: 4006 Content-Type: text/html; charset=UTF-8 Content-Language: zh-cn

    Apache web server has been installed on our SaltStack minion.

     

    Conclusion:

    We have successfully installed SaltStack Minion on CentOS 8 server and remotely execute commands on it. Before you start to use SaltStack, we strongly recommend you to purchase and read Mastering SaltStack - Second Edition by Joseph Hall. This book will guide you about the Saltstack architecture, basic concepts and practical examples.

    No comments:

    Post a comment