Operations 6 min read

Configuring GitHub, Jenkins, and SaltStack for Automated CI/CD Deployment

This guide provides step‑by‑step instructions for uploading a Jenkinsfile to GitHub, setting up Jenkins credentials and shared libraries, installing required plugins, configuring SaltStack master and minion, and troubleshooting common Git and SaltStack issues in a CI/CD pipeline.

DevOps Cloud Academy
DevOps Cloud Academy
DevOps Cloud Academy
Configuring GitHub, Jenkins, and SaltStack for Automated CI/CD Deployment

1. GitHub Configuration

1.1 Upload the Jenkinsfile to the GitHub repository at https://github.com/zeyangli/ShareLibrary-jenkins.git .

2. Jenkins Configuration

2.1 Add GitLab credentials via Credentials → System → Add Credentials.

2.2 Configure the Shared Library under System → Global Pipeline Libraries.

2.3 Install required plugins:

saltstack ansicolor

3. Deployment Configuration

3.1 Install Salt master and Salt API on the master node:

yum -y install salt salt-master salt-api
vim /etc/salt/master  # add the following content (example version 2015.5.10)

Configure the master (example snippet):

rest_cherrypy:
  port: 9000
  disable_ssl: True

external_auth:
  pam:
  saltapi:
    - .* 
    - '@wheel'
    - '@runner'

file_roots:
  base:
    - /srv/salt

Start services and create a user for the API:

service salt-master start
service salt-api start
useradd saltapi
passwd saltapi  # set password, e.g., 123456

3.2 Deploy Salt minion on application servers:

yum -y install salt-minion
echo "master: 10.10.1.1" > /etc/salt/minion

3.3 Test the setup:

salt-key -L
salt-key -a xxxxxxx
salt xxx test.
ping

Verify API login:

curl http://127.0.0.1:9000/login -d username='saltapi' -d password='123456' -d eauth='pam'

FAQ

1. Updating Git version on CentOS 6 (default yum provides Git 1.7.1 which is too old):

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
wget https://github.com/git/git/archive/v2.3.0.zip
unzip v2.3.0.zip
cd git
make prefix=/usr/local/git all
vim /etc/profile
export PATH=/usr/local/git/bin:$PATH
source /etc/profile

2. Re‑installing Git when project build fails due to missing Git executable:

Started by user admin
java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    ... (stack trace omitted for brevity) ...
Caused: hudson.plugins.git.GitException: Could not init /var/lib/jenkins/caches/git-...

Solution: In Jenkins System Settings → Global Tool Configuration, update the path to the Git executable.

3. Missing SaltStack plugin error:

java.lang.NoSuchMethodError: No such DSL method 'salt' found among steps
CI/CDAutomationGitHubJenkinsSaltStack
DevOps Cloud Academy
Written by

DevOps Cloud Academy

Exploring industry DevOps practices and technical expertise.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.