Prerequisites Before you begin, ensure you have the following packages installed on your system:
- Git version 2.34.1
- Docker version 24.0.6, build ed223bc
- Docker Compose version v2.21.0
First, copy the line below and paste on your prompt to clone the repository:
git clone https://github.com/arthurcadore/capacita-puppet
If you don't have installed the package Git yet, do it before try to clone the respository!
Navigate to the project directory:
cd ./capacita-puppet
If you don't have Docker (and Docker-compose) installed on your system yet, it can be installed by run the following commands (Script for Ubuntu 22.04):
./docker/installDocker.sh
If you had to install docker, please remember to reboot you machine to grant user privileges for docker application.
In sequence, configure the environment archives for the application containers, you can do this by edditing the files in /config/
directory:
hosts -> Configure Hostnames for client nodes.
puppet.conf -> Configure parameters for MasterNode Instace, as memory threshold.
In database.ini
file you'll need to configure the IP-address of your database, user and password. If you wanna to save in database externally, just point the new database IP-address.
Once you had configured the database user/password on database.ini
file, go to ./database/setup.sql
file to match this parameters in the script that will configure the database container.
-- Create a new user with the password specified:
CREATE USER youruser WITH PASSWORD 'yourpassword';
-- Alter ownership of the 'puppetdb' database to youruser:
ALTER DATABASE imn OWNER TO youruser;
-- Allow your user to connect from any host
ALTER USER youruser WITH SUPERUSER;
Run the command below to start docker-compose file:
docker compose up &
The "&" character creates a process id for the command inputed in, with means that the container will not stop when you close the terminal.
Once the container is up and running, you can access the application at por TCP/8140
, as defined in the docker-compose.yml file.
By default, the CLI access to the container is closed, so nobody can access it externally, only the application web Page.
To access the application command line, first loggin into host device using SSH or another method, then use the command below:
docker exec -it puppetserver bash
The command above will start a bash process in the application container, that with the -it (interative) flag will display the prompt to user.
To exit from container's command line interface, use the command exit
.
By default, docker-compose.yml comes with a port mapping to expose the PostgreSQL port from database's container externally. The default port to PostgreSQL DB (which is the same that is mapped externally by default) is 5432
.
So, to access the application database you can use any SQL client software, as HeidiSQL for example, the credentials are configured in ./database/setup.sql
.
To stop the running container, use the following command:
docker-compose down
This command stops and removes the containers, networks, defined in the docker-compose.yml file.