From de25209d8bf5f149434b0f8a6e108d197e5daa6a Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 09:25:28 +0200 Subject: [PATCH 01/12] Typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a2c0c2..02e5d67 100644 --- a/README.md +++ b/README.md @@ -325,7 +325,7 @@ bareos_dir_tls_verify_peer: false # A list of catalogs to configure. bareos_dir_catalogs: [] -# A list of consoled to configure. +# A list of consoles to configure. bareos_dir_consoles: [] # A list of counters to configure. From 19aedf8aa0bec48394147b083137d3111cc18aac Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 15:39:08 +0200 Subject: [PATCH 02/12] Add community.general collection. --- requirements.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index f9786d0..2747ef3 100644 --- a/requirements.yml +++ b/requirements.yml @@ -11,6 +11,8 @@ roles: # The `core_dependencies` and `postfix` roles provide mailing capabilities for the `bareos_role`: "dir". # - name: robertdebock.core_dependencies # - name: robertdebock.postfix - # use bconsole to be able to run better tests for Bareos Director - name: adfinis.bareos_console +collections: + - name: community.general + - name: community.postgresql From e8243b45e242e4461b1c171a144036dd49571197 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 16:19:45 +0200 Subject: [PATCH 03/12] More honest. --- README.md | 5 ++--- meta/main.yml | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 02e5d67..ccb30ca 100644 --- a/README.md +++ b/README.md @@ -390,10 +390,9 @@ This role has been tested on these [container images](https://hub.docker.com/u/r |container|tags| |---------|----| |[Debian](https://hub.docker.com/r/robertdebock/debian)|buster, bullseye, bookworm| -|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|7, 8, 9| +|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9| |[Fedora](https://hub.docker.com/r/robertdebock/fedora/)|38,39| -|[opensuse](https://hub.docker.com/r/robertdebock/opensuse)|all| -|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy, focal| +|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy| The minimum version of Ansible required is 2.12, tests have been done to: diff --git a/meta/main.yml b/meta/main.yml index f8502f4..bb30429 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,7 +15,6 @@ galaxy_info: - buster - name: EL versions: - - "7" - "8" - "9" - name: Fedora From 7cdba459e8648f1c26b360b8a928601fb9f91ca1 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 15:57:27 +0200 Subject: [PATCH 04/12] Make GitHub CI work. --- .github/workflows/molecule.yml | 23 ++++++++++++++++------- .gitlab-ci.yml | 4 ---- README.md | 2 +- meta/main.yml | 5 ++--- molecule/default/molecule.yml | 6 +++--- requirements.txt | 6 +++--- requirements.yml | 1 + 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index de0f207..9542456 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -32,8 +32,6 @@ jobs: tag: "bullseye" - image: "debian" tag: "buster" - - image: "enterpriselinux" - tag: "7" - image: "enterpriselinux" tag: "8" - image: "enterpriselinux" @@ -54,15 +52,26 @@ jobs: tag: "focal" steps: - name: checkout - uses: actions/checkout@v3 - with: - path: "${{ github.repository }}" + uses: actions/checkout@v4 + - name: disable apparmor for mysql run: sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ + - name: parse apparmor for mysql run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - - name: molecule - uses: robertdebock/molecule-action@6.0.0 + + - name: Set up Python 3. + uses: actions/setup-python@v5 with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: molecule + run: molecule converge + env: image: ${{ matrix.config.image }} tag: ${{ matrix.config.tag }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 679c2d2..8265e3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,14 +18,10 @@ molecule: tag: "bullseye" - image: "debian" tag: "buster" - - image: "enterpriselinux" - tag: "7" - image: "enterpriselinux" tag: "8" - image: "enterpriselinux" tag: "latest" - - image: "fedora" - tag: "37" - image: "fedora" tag: "38" - image: "opensuse" diff --git a/README.md b/README.md index ccb30ca..8e0061c 100644 --- a/README.md +++ b/README.md @@ -391,7 +391,7 @@ This role has been tested on these [container images](https://hub.docker.com/u/r |---------|----| |[Debian](https://hub.docker.com/r/robertdebock/debian)|buster, bullseye, bookworm| |[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9| -|[Fedora](https://hub.docker.com/r/robertdebock/fedora/)|38,39| +|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|38, 39| |[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy| The minimum version of Ansible required is 2.12, tests have been done to: diff --git a/meta/main.yml b/meta/main.yml index bb30429..83cdb16 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,12 +15,11 @@ galaxy_info: - buster - name: EL versions: - - "8" - - "9" + - all - name: Fedora versions: - - "37" - "38" + - "39" - name: opensuse versions: - all diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 60bd088..bc4f2cf 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -18,9 +18,9 @@ platforms: image: "${namespace:-robertdebock}/${image:-fedora}:${tag:-latest}" command: /sbin/init volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro - privileged: yes - pre_build_image: yes + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true provisioner: name: ansible verifier: diff --git a/requirements.txt b/requirements.txt index 76ee97c..79d6320 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Pinning ansible-compat version due to [bug](https://github.com/ansible-community/molecule/issues/3903) -ansible-compat == 4.* -molecule == 6.* +ansible-compat == 24.* +molecule == 24.* molecule-plugins == 23.* docker == 7.* -ansible-lint == 6.* +ansible-lint == 24.* paramiko == 3.* diff --git a/requirements.yml b/requirements.yml index 2747ef3..01d0fb4 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,4 +1,5 @@ --- + roles: - name: robertdebock.bootstrap - name: adfinis.bareos_repository From dca71d81feb51ca3dd35a3285695cc77d02dc819 Mon Sep 17 00:00:00 2001 From: Patrick Hasler Date: Thu, 11 Jul 2024 16:39:15 +0200 Subject: [PATCH 05/12] fix: jinja if statements job.conf.j2 --- templates/job.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/job.conf.j2 b/templates/job.conf.j2 index 433e682..2eedc53 100644 --- a/templates/job.conf.j2 +++ b/templates/job.conf.j2 @@ -101,6 +101,7 @@ {% if item.virtual_full_backup_pool is defined %} Virtual Full Backup Pool = {{ item.virtual_full_backup_pool }} {% endif %} + {% if item.run_script is defined %} Run Script { {% if item.run_script.command is defined %} @@ -118,8 +119,8 @@ {% if item.run_script.runs_when is defined %} Runs When = {{ item.run_script.runs_when }} {% endif %} - } {% endif %} + {% if item.run_before_job is defined %} RunBeforeJob = {{ item.run_before_job }} {% endif %} From 555689dc091af73f38baf5618e3e5752ec9f896b Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 09:25:28 +0200 Subject: [PATCH 06/12] Typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a2c0c2..02e5d67 100644 --- a/README.md +++ b/README.md @@ -325,7 +325,7 @@ bareos_dir_tls_verify_peer: false # A list of catalogs to configure. bareos_dir_catalogs: [] -# A list of consoled to configure. +# A list of consoles to configure. bareos_dir_consoles: [] # A list of counters to configure. From 737c1b9a3f745165b9a2987c03517c147e2110df Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 15:39:08 +0200 Subject: [PATCH 07/12] Add community.general collection. --- requirements.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index f9786d0..2747ef3 100644 --- a/requirements.yml +++ b/requirements.yml @@ -11,6 +11,8 @@ roles: # The `core_dependencies` and `postfix` roles provide mailing capabilities for the `bareos_role`: "dir". # - name: robertdebock.core_dependencies # - name: robertdebock.postfix - # use bconsole to be able to run better tests for Bareos Director - name: adfinis.bareos_console +collections: + - name: community.general + - name: community.postgresql From 36b78f56d77f82a31122ad8992fa1cfb1055af96 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 16:19:45 +0200 Subject: [PATCH 08/12] More honest. --- README.md | 5 ++--- meta/main.yml | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 02e5d67..ccb30ca 100644 --- a/README.md +++ b/README.md @@ -390,10 +390,9 @@ This role has been tested on these [container images](https://hub.docker.com/u/r |container|tags| |---------|----| |[Debian](https://hub.docker.com/r/robertdebock/debian)|buster, bullseye, bookworm| -|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|7, 8, 9| +|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9| |[Fedora](https://hub.docker.com/r/robertdebock/fedora/)|38,39| -|[opensuse](https://hub.docker.com/r/robertdebock/opensuse)|all| -|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy, focal| +|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy| The minimum version of Ansible required is 2.12, tests have been done to: diff --git a/meta/main.yml b/meta/main.yml index f8502f4..bb30429 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,7 +15,6 @@ galaxy_info: - buster - name: EL versions: - - "7" - "8" - "9" - name: Fedora From c4556daf3a5fc453ec231b119d256505a7f44539 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 1 Jul 2024 15:57:27 +0200 Subject: [PATCH 09/12] Make GitHub CI work. --- .github/workflows/molecule.yml | 23 ++++++++++++++++------- .gitlab-ci.yml | 4 ---- README.md | 2 +- meta/main.yml | 5 ++--- molecule/default/molecule.yml | 6 +++--- requirements.txt | 6 +++--- requirements.yml | 1 + 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index de0f207..9542456 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -32,8 +32,6 @@ jobs: tag: "bullseye" - image: "debian" tag: "buster" - - image: "enterpriselinux" - tag: "7" - image: "enterpriselinux" tag: "8" - image: "enterpriselinux" @@ -54,15 +52,26 @@ jobs: tag: "focal" steps: - name: checkout - uses: actions/checkout@v3 - with: - path: "${{ github.repository }}" + uses: actions/checkout@v4 + - name: disable apparmor for mysql run: sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ + - name: parse apparmor for mysql run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - - name: molecule - uses: robertdebock/molecule-action@6.0.0 + + - name: Set up Python 3. + uses: actions/setup-python@v5 with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: molecule + run: molecule converge + env: image: ${{ matrix.config.image }} tag: ${{ matrix.config.tag }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 679c2d2..8265e3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,14 +18,10 @@ molecule: tag: "bullseye" - image: "debian" tag: "buster" - - image: "enterpriselinux" - tag: "7" - image: "enterpriselinux" tag: "8" - image: "enterpriselinux" tag: "latest" - - image: "fedora" - tag: "37" - image: "fedora" tag: "38" - image: "opensuse" diff --git a/README.md b/README.md index ccb30ca..8e0061c 100644 --- a/README.md +++ b/README.md @@ -391,7 +391,7 @@ This role has been tested on these [container images](https://hub.docker.com/u/r |---------|----| |[Debian](https://hub.docker.com/r/robertdebock/debian)|buster, bullseye, bookworm| |[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9| -|[Fedora](https://hub.docker.com/r/robertdebock/fedora/)|38,39| +|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|38, 39| |[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy| The minimum version of Ansible required is 2.12, tests have been done to: diff --git a/meta/main.yml b/meta/main.yml index bb30429..83cdb16 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,12 +15,11 @@ galaxy_info: - buster - name: EL versions: - - "8" - - "9" + - all - name: Fedora versions: - - "37" - "38" + - "39" - name: opensuse versions: - all diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 60bd088..bc4f2cf 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -18,9 +18,9 @@ platforms: image: "${namespace:-robertdebock}/${image:-fedora}:${tag:-latest}" command: /sbin/init volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro - privileged: yes - pre_build_image: yes + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true provisioner: name: ansible verifier: diff --git a/requirements.txt b/requirements.txt index 76ee97c..79d6320 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Pinning ansible-compat version due to [bug](https://github.com/ansible-community/molecule/issues/3903) -ansible-compat == 4.* -molecule == 6.* +ansible-compat == 24.* +molecule == 24.* molecule-plugins == 23.* docker == 7.* -ansible-lint == 6.* +ansible-lint == 24.* paramiko == 3.* diff --git a/requirements.yml b/requirements.yml index 2747ef3..01d0fb4 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,4 +1,5 @@ --- + roles: - name: robertdebock.bootstrap - name: adfinis.bareos_repository From a8eefe729195412f306b689ea749b764edd9162b Mon Sep 17 00:00:00 2001 From: Patrick Hasler Date: Thu, 11 Jul 2024 16:39:15 +0200 Subject: [PATCH 10/12] fix: jinja if statements job.conf.j2 --- templates/job.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/job.conf.j2 b/templates/job.conf.j2 index 433e682..2eedc53 100644 --- a/templates/job.conf.j2 +++ b/templates/job.conf.j2 @@ -101,6 +101,7 @@ {% if item.virtual_full_backup_pool is defined %} Virtual Full Backup Pool = {{ item.virtual_full_backup_pool }} {% endif %} + {% if item.run_script is defined %} Run Script { {% if item.run_script.command is defined %} @@ -118,8 +119,8 @@ {% if item.run_script.runs_when is defined %} Runs When = {{ item.run_script.runs_when }} {% endif %} - } {% endif %} + {% if item.run_before_job is defined %} RunBeforeJob = {{ item.run_before_job }} {% endif %} From 78bb14bfc3913aae0e857f66391cc5e3187095ea Mon Sep 17 00:00:00 2001 From: Patrick Hasler Date: Thu, 11 Jul 2024 17:06:45 +0200 Subject: [PATCH 11/12] fix: bareos_dir_tls conditional tasks/main.yml --- tasks/main.yml | 7 +++---- templates/job.conf.j2 | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 8fc0498..d5a7ae9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -70,10 +70,9 @@ dest: bareos_dir_tls_cert_key_dest when: - bareos_dir_tls_enable - - bareos_dir_tls_enable - - bareos_dir_tls_ca_cert.src != "" - - bareos_dir_tls_cert.src != "" - - bareos_dir_tls_cert_key.src != "" + - bareos_dir_tls_ca_cert_src != "" + - bareos_dir_tls_cert_src != "" + - bareos_dir_tls_cert_key_src != "" - name: Place bareos-dir.conf ansible.builtin.template: diff --git a/templates/job.conf.j2 b/templates/job.conf.j2 index 2eedc53..3b63bde 100644 --- a/templates/job.conf.j2 +++ b/templates/job.conf.j2 @@ -74,6 +74,7 @@ {% endif %} {% if item.plugin_options is defined %} Dir Plugin Options = {{ item.plugin_options }} +{% endif %} {% if item.max_concurrent_copies is defined %} Max Concurrent Copies = {{ item.max_concurrent_copies }} {% endif %} @@ -119,6 +120,7 @@ {% if item.run_script.runs_when is defined %} Runs When = {{ item.run_script.runs_when }} {% endif %} + } {% endif %} {% if item.run_before_job is defined %} @@ -175,6 +177,7 @@ {% if item.prefer_mounted_volumes is defined %} Prefer Mounted Volumes = {{ item.prefer_mounted_volumes | ternary('yes', 'no') }} {% endif %} + } {% else %} # This file is not enabled. From 453e172a29dd0e1eb2a91d1283a1eaf6ac46b70d Mon Sep 17 00:00:00 2001 From: Patrick Hasler Date: Thu, 11 Jul 2024 17:14:43 +0200 Subject: [PATCH 12/12] chore(lint): true/false rather than yes/no --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3f4f477..92afcfc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,10 +25,10 @@ bareos_dir_max_concurrent_jobs: 100 bareos_dir_message: Daemon # Enable TLS. -bareos_dir_tls_enable: yes +bareos_dir_tls_enable: true # Verify the peer. -bareos_dir_tls_verify_peer: no +bareos_dir_tls_verify_peer: false # The path of the CA certificate file. bareos_dir_tls_ca_cert_src: ""