Skip to content

Commit 199452e

Browse files
committed
Fixes ansible-lint issues
1 parent b95a0ec commit 199452e

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

.ansible-lint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22
skip_list:
33
- experimental # all rules tagged as experimental
4-
- fqcn-builtins

molecule/default/converge.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
- name: Converge
44
hosts: all
55
vars:
6-
role_name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
6+
this_role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
77

88
tasks:
9-
- name: "Include {{ role_name }}"
9+
- name: "Include {{ this_role }}"
1010
ansible.builtin.include_role:
11-
name: "{{ role_name }}"
11+
name: "{{ this_role }}"
1212
...

molecule/default/verify.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
goss_format: tap
2020
tasks:
2121
- name: Download and install Goss
22-
get_url:
22+
ansible.builtin.get_url:
2323
url: "{{ goss_url }}"
2424
dest: "{{ goss_dst }}"
2525
sha256sum: "{{ goss_sha256sum }}"
@@ -29,34 +29,34 @@
2929
retries: 3
3030

3131
- name: Copy Goss tests to remote
32-
copy:
32+
ansible.builtin.copy:
3333
src: "{{ item }}"
3434
dest: "{{ goss_test_directory }}/{{ item | basename }}"
3535
mode: 0644
3636
with_fileglob:
3737
- "{{ lookup('env', 'MOLECULE_VERIFIER_TEST_DIRECTORY') }}/test_*.yml"
3838

3939
- name: Register test files
40-
shell: "ls {{ goss_test_directory }}/test_*.yml"
40+
ansible.builtin.shell: "ls {{ goss_test_directory }}/test_*.yml"
4141
changed_when: false
4242
register: test_files
4343

4444
- name: Execute Goss tests
4545
environment:
46-
# yamllint disable-line rule:line-length
46+
# yamllint disable rule:line-length
4747
PATH: '/opt/rh/rh-git218/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
48-
command: "{{ goss_dst }} -g {{ item }} validate -f {{ goss_format }}"
48+
ansible.builtin.command: "{{ goss_dst }} -g {{ item }} validate -f {{ goss_format }}"
4949
changed_when: false
5050
register: test_results
5151
with_items: "{{ test_files.stdout_lines }}"
5252

5353
- name: Display details about the Goss results
54-
debug:
54+
ansible.builtin.debug:
5555
msg: "{{ item.stdout_lines }}"
5656
with_items: "{{ test_results.results }}"
5757

5858
- name: Fail when tests fail
59-
fail:
59+
ansible.builtin.fail:
6060
msg: "Goss failed to validate"
6161
when: item.rc != 0
6262
with_items: "{{ test_results.results }}"

tasks/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22

33
- name: Resolve platform specific vars
4-
include_vars: "{{ item }}"
4+
ansible.builtin.include_vars: "{{ item }}"
55
with_first_found:
66
- files:
77
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
@@ -12,51 +12,51 @@
1212
- '{{ role_path }}/vars'
1313

1414
- name: Install GPG package
15-
package:
15+
ansible.builtin.package:
1616
name: "{{ gpg_package | default(['gpg']) }}"
1717
update_cache: true
1818
state: present
1919

2020
- name: Create GPG agent config directory
21-
file:
21+
ansible.builtin.file:
2222
path: /etc/skel/.gnupg
2323
state: directory
2424
mode: 0700
2525

2626
- name: Install GPG agent config file
27-
template:
27+
ansible.builtin.template:
2828
src: gpg-agent.conf
2929
dest: /etc/skel/.gnupg/
3030
mode: 0600
3131

3232
- name: Check if /etc/skel/.bash_profile exists
33-
stat:
33+
ansible.builtin.stat:
3434
path: /etc/skel/.bash_profile
3535
register: bash_profile
3636

3737
- name: Create .bash_profile
3838
when: not bash_profile.stat.exists
39-
copy:
39+
ansible.builtin.copy:
4040
content: ''
4141
dest: /etc/skel/.bash_profile
4242
mode: 0644
4343

4444
- name: Configure environment for GPG agent
45-
lineinfile:
45+
ansible.builtin.lineinfile:
4646
path: /etc/skel/.bash_profile
4747
regexp: '^export GPG_TTY.*'
4848
line: 'export GPG_TTY=$(tty)'
4949
state: present
5050

5151
- name: Configure bash_profile for GPG agent
52-
lineinfile:
52+
ansible.builtin.lineinfile:
5353
path: /etc/skel/.bash_profile
5454
regexp: '^gpg-agent --daemon.*'
5555
line: 'gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info"'
5656
state: present
5757

5858
- name: Configure bashrc for GPG agent
59-
blockinfile:
59+
ansible.builtin.blockinfile:
6060
path: /etc/skel/.bashrc
6161
marker: "# {mark} ANSIBLE MANAGED BLOCK"
6262
block: |

0 commit comments

Comments
 (0)