Skip to content

Commit afb4895

Browse files
authored
Merge pull request #126 from bedroge/fix_lint_errors
Fix Ansible lint errors
2 parents 376b8a1 + eda426e commit afb4895

File tree

10 files changed

+33
-31
lines changed

10 files changed

+33
-31
lines changed

.github/workflows/Dockerfile-centos-7

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ USER root
55
RUN yum install -y epel-release
66
RUN yum install -y ansible
77
RUN yum install -y cronie
8+
RUN yum install -y git
89

910
COPY ./.github/workflows/test-playbook.sh /test-playbook.sh
1011

.github/workflows/Dockerfile-rockylinux-8

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ USER root
55
RUN yum install -y epel-release
66
RUN yum install -y ansible
77
RUN yum install -y cronie
8+
RUN yum install -y git
89

910
COPY ./.github/workflows/test-playbook.sh /test-playbook.sh
1011

.github/workflows/Dockerfile-ubuntu-18.04

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:18.04
33
USER root
44

55
RUN apt-get update
6-
RUN apt-get install -y cron gpg python3.8 python3-pip systemd
6+
RUN apt-get install -y cron gpg python3.8 python3-pip systemd git
77

88
RUN python3.8 -m pip install -U pip
99
RUN python3.8 -m pip install ansible

.github/workflows/Dockerfile-ubuntu-20.04

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:20.04
33
USER root
44

55
RUN apt-get update
6-
RUN apt-get install -y cron gpg python3-pip
6+
RUN apt-get install -y cron gpg python3-pip git
77
RUN env DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -y systemd
88

99
RUN pip3 install ansible

inventory/group_vars/all.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ eessi_cvmfs_repositories:
7575
- CVMFS_AUTO_TAG_TIMESPAN="30 days ago"
7676
- CVMFS_GARBAGE_COLLECTION=true
7777
client_options: []
78-
use_for_ci: no
78+
use_for_ci: false
7979
- repository: ci.eessi-hpc.org
8080
stratum0: rug-nl.stratum0.cvmfs.eessi-infra.org
8181
owner: "{{ cvmfs_repo_owner | default('root') }}"
@@ -84,7 +84,7 @@ eessi_cvmfs_repositories:
8484
- CVMFS_AUTO_GC=false
8585
- CVMFS_GARBAGE_COLLECTION=true
8686
client_options: []
87-
use_for_ci: yes
87+
use_for_ci: true
8888

8989
# Override all the Galaxy defaults by our EESSI defaults.
9090
# This is required, beucase the galaxy_* variables are used inside the Ansible tasks.

prepare-client-packages.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919

2020
- name: Create directory structure for the CVMFS config
2121
file:
22-
path: "{{ item }}"
23-
state: directory
24-
mode: 0775
22+
path: "{{ item }}"
23+
state: directory
24+
mode: 0775
2525
with_items:
26-
- "{{ package_source_dir }}"
27-
- "{{ package_source_dir }}/etc"
28-
- "{{ package_source_dir }}/etc/cvmfs"
29-
- "{{ package_source_dir }}/etc/cvmfs/keys"
30-
- "{{ package_source_dir }}/etc/cvmfs/keys/{{ eessi_domain }}"
31-
- "{{ package_source_dir }}/etc/cvmfs/domain.d"
26+
- "{{ package_source_dir }}"
27+
- "{{ package_source_dir }}/etc"
28+
- "{{ package_source_dir }}/etc/cvmfs"
29+
- "{{ package_source_dir }}/etc/cvmfs/keys"
30+
- "{{ package_source_dir }}/etc/cvmfs/keys/{{ eessi_domain }}"
31+
- "{{ package_source_dir }}/etc/cvmfs/domain.d"
3232

3333
- name: Make EESSI CVMFS public key files
3434
copy:

requirements.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
roles:
55

66
- name: galaxyproject.cvmfs
7-
version: 0.2.14
7+
src: https://github.com/galaxyproject/ansible-cvmfs
8+
version: 7fa3a81
89

910
- name: geerlingguy.repo-epel
1011
version: 3.0.0
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
cvmfs_start_transaction: yes
2-
cvmfs_publish_transaction: yes
3-
cvmfs_abort_transaction_on_failures: yes
1+
cvmfs_start_transaction: true
2+
cvmfs_publish_transaction: true
3+
cvmfs_abort_transaction_on_failures: true

roles/create_cvmfs_content_structure/tasks/do_repo.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@
22
---
33

44
- name: "Include the vars file for {{ cvmfs_repo }}"
5-
include_vars: "{{ cvmfs_repo }}.yml"
5+
ansible.builtin.include_vars: "{{ cvmfs_repo }}.yml"
66

77
- name: Start transaction
8-
command: "cvmfs_server transaction {{ cvmfs_repo }}"
8+
ansible.builtin.command: "cvmfs_server transaction {{ cvmfs_repo }}"
99
when: cvmfs_start_transaction
1010

11-
- block:
12-
11+
- name: Apply changes to CVMFS repository, if there are any
12+
block:
1313
- name: "Create symlinks"
14-
file:
14+
ansible.builtin.file:
1515
path: "/cvmfs/{{ cvmfs_repo }}/{{ item }}"
1616
src: "{{ symlinks[item] }}"
1717
state: link
18-
force: yes
18+
force: true
1919
with_items: "{{ symlinks }}"
2020
register: create_symlinks
2121

2222
- name: "Copy files"
23-
copy:
23+
ansible.builtin.copy:
2424
src: "{{ item.name }}"
2525
dest: "/cvmfs/{{ cvmfs_repo }}/{{ item.dest }}"
2626
mode: "{{ item.mode }}"
2727
with_items: "{{ files }}"
2828
register: create_files
2929

3030
- name: Publish transaction
31-
command: "cvmfs_server publish {{ cvmfs_repo }}"
31+
ansible.builtin.command: "cvmfs_server publish {{ cvmfs_repo }}"
3232
when:
3333
- cvmfs_start_transaction
3434
- cvmfs_publish_transaction
3535
- create_symlinks.changed or create_files.changed
3636
register: publish
3737

3838
- name: Abort transaction
39-
command: "cvmfs_server abort {{ cvmfs_repo }}"
39+
ansible.builtin.command: "cvmfs_server abort {{ cvmfs_repo }}"
4040
when: publish is skipped
4141

4242
rescue:
4343
- name: Abort transaction
44-
command: "cvmfs_server abort {{ cvmfs_repo }}"
44+
ansible.builtin.command: "cvmfs_server abort {{ cvmfs_repo }}"
4545
when: cvmfs_start_transaction and cvmfs_abort_transaction_on_failures
4646

4747
- name: Exit because of failure
48-
fail:
48+
ansible.builtin.fail:
4949
msg: "Task {{ ansible_failed_task }} failed, with result {{ ansible_failed_result }}."

roles/create_cvmfs_content_structure/tasks/main.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
- name: "Find which repositories have a vars file..."
55
delegate_to: localhost
6-
stat:
6+
ansible.builtin.stat:
77
path: "{{ role_path }}/vars/{{ item.repository }}.yml"
88
with_items: "{{ eessi_cvmfs_repositories }}"
99
register: repo_vars_file
1010

1111
- name: "Apply do_repo for each repository with a vars file"
12-
include_tasks: do_repo.yml
12+
ansible.builtin.include_tasks: do_repo.yml
1313
vars:
1414
cvmfs_repo: "{{ repo_vars_file.item.repository }}"
1515
when: repo_vars_file.stat.exists
@@ -19,4 +19,3 @@
1919
args:
2020
apply:
2121
become: "{{ 'yes' if repo_vars_file.item.owner == 'root' else 'no' }}"
22-

0 commit comments

Comments
 (0)