This role installs the pakiti client using Ansible. It has three different modes that can be activated or disabled using optional variables:
- install the pakiti client
- install a cron job that executes the client once every day at a random hour and minute
- executes the client
Only ansible. It was tested using ansible 2.10.
pakiti_server- pakiti server fdqn/dnspakiti_site- to better identify to which team a server belongs to we have to use a sort of tag
The optional variables are defined on the defaults/main.yml file, open it to view the default value for each variable.
pakiti_install- if role will install the pakiti softwarepakiti_install_cron- when we want to have a way to only push, we can skip the cronjob creation on the installation processpakiti_push- if role will execute the pakiti software that sends information to the serverpakiti_user- the user that will be created on the server side and that will execute the pakiti client executionpakiti_repository- which git repository should be installed / clonedpakiti_repository_version- which client version should be installedpakiti_cron_weekday: on which weekdays the cronjob will be executed, by default every day.pakiti_cron_hour: on the weekdays that you chose to execute the client, you have to choose minutes and hours that you want the execution to happenpakiti_cron_minute: on the weekdays that you chose to execute the client, you have to choose minutes and hours that you want the execution to happengithub_repository- git repository link that has the client installation datapakiti_server_url- URL that the client uses to send datapakiti_exec- client script that will be executedpakiti_uninstall- to uninstall pakiti (simply deletes the pakiti folder)
Only ansible and a way to elevate privileges to sudo or root, so that the role can install OS dependencies and create the user that will execute the client.
roles:
- role: ansible_pakiti_client
vars:
pakiti_server: pakiti.example.com
pakiti_site: my_teamIf you want to only run this role without any other role, you can add --tags pakiti to your command line.
Notes about on how to develop this role.
Create a virtual environment, run the linters and tests
virtualenv venv --python=python3
. venv/bin/activate
pip install -r requirements/dev.txt
make lint
molecule test