diff --git a/README.md b/README.md index 7e7cfce..9e64c9e 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Configure and operate a basic cloud-native service: running anything from cypto | _binary_strip_components_ | Strip NUMBER leading components/directories from file names on extraction | `0` | | _destination_directory_ | directory where the binary file will be placed after downloading/extracting | `/usr/local/bin` | | _systemd_ | custom service type & unit, service and install properties | `{}` | -| _systemd.enable_network_accounting_ | enable IP accounting for network traffic tracking | `true` | +| _systemd.enable_accounting_ | enable systemd resource accounting (CPU, Memory, IO, Tasks, IP) | `true` | ### Kubernetes (k8s) @@ -124,7 +124,7 @@ collections: ingressPort: 51820 servicePort: 51820 systemd: - enable_network_accounting: true + enable_accounting: true service_properties: ExecStop: /usr/local/bin/wg-quick down wg0 Restart: on-failure diff --git a/defaults/main.yml b/defaults/main.yml index 3c4ab04..0115757 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -85,7 +85,7 @@ systemd: {} # unit_properties: {} # service_properties: {} # install_properties: {} -# enable_network_accounting: true +# enable_accounting: true systemd_environment_directive: "" diff --git a/tasks/common/custom-facts.yml b/tasks/common/custom-facts.yml index 902d766..dd081bc 100644 --- a/tasks/common/custom-facts.yml +++ b/tasks/common/custom-facts.yml @@ -62,7 +62,7 @@ 'MemoryHigh': memory, 'Restart': restart_policy } - | combine((systemd.enable_network_accounting | default(true)) | ternary({'IPAccounting': 'yes'}, {}), recursive=True) + | combine((systemd.enable_accounting | default(true)) | ternary({'CPUAccounting': 'yes', 'MemoryAccounting': 'yes', 'IOAccounting': 'yes', 'TasksAccounting': 'yes', 'IPAccounting': 'yes'}, {}), recursive=True) }} _default_unit_install: WantedBy: multi-user.target diff --git a/tests/molecule/container-basic/molecule.yml b/tests/molecule/container-basic/molecule.yml index e3b14d4..dc3cd69 100644 --- a/tests/molecule/container-basic/molecule.yml +++ b/tests/molecule/container-basic/molecule.yml @@ -16,6 +16,7 @@ provisioner: prepare: ../prepare-docker.yml env: ANSIBLE_ROLES_PATH: "../../../../" + ANSIBLE_ALLOW_BROKEN_CONDITIONALS: "True" verifier: name: testinfra directory: ./tests diff --git a/tests/molecule/container-full/molecule.yml b/tests/molecule/container-full/molecule.yml index 488969e..3b612e1 100644 --- a/tests/molecule/container-full/molecule.yml +++ b/tests/molecule/container-full/molecule.yml @@ -17,6 +17,7 @@ provisioner: prepare: ../prepare-docker.yml env: ANSIBLE_ROLES_PATH: "../../../../" + ANSIBLE_ALLOW_BROKEN_CONDITIONALS: "True" verifier: name: testinfra directory: ./tests diff --git a/tests/molecule/container-uninstall/molecule.yml b/tests/molecule/container-uninstall/molecule.yml index f17b900..abaa5c8 100644 --- a/tests/molecule/container-uninstall/molecule.yml +++ b/tests/molecule/container-uninstall/molecule.yml @@ -17,6 +17,7 @@ provisioner: prepare: ../prepare-docker.yml env: ANSIBLE_ROLES_PATH: "../../../../" + ANSIBLE_ALLOW_BROKEN_CONDITIONALS: "True" verifier: name: testinfra directory: ./tests diff --git a/tests/molecule/prepare-docker.yml b/tests/molecule/prepare-docker.yml index e9a486f..7005051 100644 --- a/tests/molecule/prepare-docker.yml +++ b/tests/molecule/prepare-docker.yml @@ -10,4 +10,4 @@ raw: apk add --no-cache sudo python3 py3-pip - name: Install python dependencies - raw: pip install pytest-testinfra molecule-docker + raw: pip3 install --break-system-packages --ignore-installed PyYAML pytest-testinfra molecule-docker diff --git a/tests/molecule/prepare.yml b/tests/molecule/prepare.yml index b38b1b6..85c62f5 100644 --- a/tests/molecule/prepare.yml +++ b/tests/molecule/prepare.yml @@ -10,4 +10,4 @@ raw: apt-get install -y sudo python3 python3-pip iptables - name: Install python dependencies - raw: pip install pytest-testinfra molecule-docker + raw: pip3 install --break-system-packages --ignore-installed PyYAML pytest-testinfra molecule-docker diff --git a/tests/molecule/systemd-basic/molecule.yml b/tests/molecule/systemd-basic/molecule.yml index d8f98ab..9334c5f 100644 --- a/tests/molecule/systemd-basic/molecule.yml +++ b/tests/molecule/systemd-basic/molecule.yml @@ -21,6 +21,7 @@ provisioner: prepare: ../prepare.yml env: ANSIBLE_ROLES_PATH: "../../../../" + ANSIBLE_ALLOW_BROKEN_CONDITIONALS: "True" verifier: name: testinfra directory: ./tests diff --git a/tests/molecule/systemd-full/converge.yml b/tests/molecule/systemd-full/converge.yml index 7ee61bc..77ce46d 100644 --- a/tests/molecule/systemd-full/converge.yml +++ b/tests/molecule/systemd-full/converge.yml @@ -41,4 +41,4 @@ ingressPort: 9090 servicePort: 9090 systemd: - enable_network_accounting: true + enable_accounting: true diff --git a/tests/molecule/systemd-full/molecule.yml b/tests/molecule/systemd-full/molecule.yml index e3ce5ca..00563c3 100644 --- a/tests/molecule/systemd-full/molecule.yml +++ b/tests/molecule/systemd-full/molecule.yml @@ -21,6 +21,7 @@ provisioner: prepare: ../prepare.yml env: ANSIBLE_ROLES_PATH: "../../../../" + ANSIBLE_ALLOW_BROKEN_CONDITIONALS: "True" verifier: name: testinfra directory: ./tests diff --git a/tests/molecule/systemd-uninstall/molecule.yml b/tests/molecule/systemd-uninstall/molecule.yml index e23929b..528d329 100644 --- a/tests/molecule/systemd-uninstall/molecule.yml +++ b/tests/molecule/systemd-uninstall/molecule.yml @@ -21,6 +21,7 @@ provisioner: prepare: ../prepare.yml env: ANSIBLE_ROLES_PATH: "../../../../" + ANSIBLE_ALLOW_BROKEN_CONDITIONALS: "True" verifier: name: testinfra directory: ./tests