Install and configure APT-Cacher NG
See https://galaxy.ansible.com/samk/acng
acng_config: {}The configuration of acng.conf.
See chapter below for specification.
acng_service_name: apt-cacher-ngThe name of the service.
acng_config_file: /etc/apt-cacher-ng/acng.confThe path to the config file.
acng_service_state: startedThe state of the service.
acng_service_enabled: trueDetermine if the service is started on boot.
acng_admin_name:The username of the admin account
acng_admin_password:The password of the admin account
acng_admin_state: presentEnable authentication against the web page.
Ignored when acng_admin_name is not be set.
The key is the config param. The value can be either the value of the param or a dict. The dict understands these values:
ensure: can bepresent(default) orabsentvalue: the value of the param; ignored when theensurekey isabsent
Example:
acng_config:
PassThroughPattern: '^(.*):443$'
NetworkTimeout: 30
FreshIndexMaxAge:
ensure: present
value: 20
Debug:
ensure: absentThese three examples are identical:
acng_config:
Debug: 3acng_config:
Debug:
value: 3acng_config:
Debug:
ensure: present
value: 3allow HTTPS, remove the Debug param, set network timeout to 30s:
- hosts: apt_cacher_ng
roles:
- acng
vars:
acng_config:
NetworkTimeout: 30
PassThroughPattern:
value: '^(.*):443$'
Debug:
ensure: absentThe GitHub workflow is using a matrix test against multiple Ansible major versions and operating systems. The test procedure below does not allow this.
-
Create and activate a virtual environment
-
Install and run the linters
pip install yamllint ansible-lint yamllint . ansible-lint -
Define which Ansible version you want to test. The list of major Ansible versions tested by GitHub worflow is located in the molecule/requirements folder.
-
This example installs Ansible 2.13:
pip install -r molecule/requirements/ansible-2.13.txt
-
This example installs the latest version of Ansible:
pip install -r molecule/requirements/ansible-latest.txt
-
You can install any version you want to test:
pip install 'molecule[docker]' ansible-core==2.13.4
-
-
Execute molecule
MOLECULE_DISTRO=ubuntu2004 molecule test --allThis environment variable is used by molecule.yml to pull the appropriate Docker image.
Note: this command below executes all scenarios on all the distros:
./molecule/test-all.sh