In our previous blog post, we have explained Automation using Chef and Jenkins. This blog post talks about Automation using Puppet and Jenkins, which are generally used to fetch the status of the app servers before the actual deployment.
Puppet is a pull-based automation tool and an end-to-end configuration management tool that communicates via SSL encrypted connection between the server and client. Puppetarchitecture mainly consistsof a Puppet server and Puppet client. When we run a configuration in the Puppet server, we can deploy that configuration to multiple Puppet agent servers.
Puppet server Includes:-
Puppet client Includes:-
Modules are used for end-to-end configuration to specify all things the agent server has to deploy.
The Puppet server is the place where we store manifests and the modules. Manifests are the end state server description.
Hiera is the key-value store that we can feed into the module later. It contains the catalog, which is the mapping of the manifests.
The Puppet agent collects the information of the Puppet agent itself and sends that to the Puppet server. Then it requests a catalog that specifies which module needs to implement on which server. When the catalog is received, the agent ensures the server is in the matching state particularized in the catalog. After implementing the modules in the agent server, it sends back a report to the Puppet server that describes all the applied settings.
It is a PostgreSQL database that collects additional data-consuming Puppet setup and any of the running Puppet nodes. It is available in both Puppet open source edition and Puppet enterprise edition.
However, the Puppet enterprise edition is featured more than the Puppet open source edition.
DB usually fetches the matrix about the nodes running the Puppet agent in the Puppet. Using this Puppet DB, we can store the reports about the deployment of the modules and the manifests and the configurations applied to the node.
Jenkins is a continuous integration (CI) server which allows developers to update a repo multiple times a day with various developers, solving the problem of having different copies of the same source code. You can build software with each commit to the code, quickly identifying bugs using a continuous integration server. Jenkins has an extensive range of plugins, and thus the need to build software manually is reduced. Custom build rules and dependencies can be set in Jenkins as it is a highly configurable tool.
The single Jenkins server is not enough to meet specific requirements, and hence Jenkins distributed architecture is used to meet these needs.
Jenkins uses master-slave architecture to manage distributed builds. Master and slave communicate through TCP/IP protocol.
The main Jenkins server is the master. The job of the master is to schedule build jobs, dispatch builds to the slaves for actual execution, monitor the slaves, and record and build slave results.
Slave is a java executable that runs on a local machine. The primary function of a slave is to execute build jobs dispatched by the master. Characteristics of Jenkins slaves are: It hears requests from Jenkins master instance and can run on any operating system.
It is used to know which task Jenkins is currently executing. Builds are broken into sections in the build pipeline, such as units and acceptance tests, packaging, reporting, and deployment phases.
We can integrate the Puppet server with the Jenkins server using the Puppet plugin and download the reports about the configuration changes in the nodes running the Puppet. There are mainly two options available for integrating Puppet with Jenkins, one using the API Token, which is available only on the enterprise edition. We have to integrate the open-source Puppet via SSH connectivity.