Skip to content

Commit

Permalink
Change yes/no to true/false, adhere to yamlspec 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Mar 18, 2024
1 parent 00bfc97 commit 1c87de7
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/requirements2png.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
uses: ad-m/github-push-action@master
with:
directory: ${{ github.repository }}
force: yes
force: true
branch: png
3 changes: 0 additions & 3 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ rules:
line-length: disable
truthy:
check-keys: no
allowed-values:
- "yes"
- "no"

ignore: |
.tox/
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: robertdebock.cntlm
Expand All @@ -27,8 +27,8 @@ The machine needs to be prepared. In CI this is done using [`molecule/default/pr
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
Expand Down Expand Up @@ -66,7 +66,7 @@ cntlm_listen: 3128
# When you've got a password hash, you may fill it in here.
# cntlm_passntlmv2: 1234567890abcdef
cntlm_auth_ntlm: no
cntlm_auth_ntlm: false
# What hosts to omit in the proxy.
cntlm_noproxy: localhost
Expand All @@ -75,19 +75,19 @@ cntlm_noproxy: localhost
cntlm_tmp: /root
# Which IPs or CIDR subnets CNTLM is accessible from.
# Items other than 127.0.0.1 are only effective if gateway_enabled is set to `yes`.
# Items other than 127.0.0.1 are only effective if gateway_enabled is set to `true`.
cntlm_allows:
- "127.0.0.1"

# If "yes", include the default ansible_default_ipv4 IP in cntlm_allows ([inventory_hostname]['ansible_default_ipv4'] )
cntlm_allows_include_local_ipv4: no
# If "true", include the default ansible_default_ipv4 IP in cntlm_allows ([inventory_hostname]['ansible_default_ipv4'] )
cntlm_allows_include_local_ipv4: false

# By default ("0/0"), CNTLM is inaccessible from all other IP addresses.
cntlm_denies:
- "0/0"

# If yes, access to CNTLM is possible from outside of the local host, subject to cntlm_allows and cntlm_denies:
gateway_enabled: no
# If true, access to CNTLM is possible from outside of the local host, subject to cntlm_allows and cntlm_denies:
gateway_enabled: false
```
## [Requirements](#requirements)
Expand Down
12 changes: 6 additions & 6 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cntlm_listen: 3128

# When you've got a password hash, you may fill it in here.
# cntlm_passntlmv2: 1234567890abcdef
cntlm_auth_ntlm: no
cntlm_auth_ntlm: false

# What hosts to omit in the proxy.
cntlm_noproxy: localhost
Expand All @@ -30,16 +30,16 @@ cntlm_noproxy: localhost
cntlm_tmp: /root

# Which IPs or CIDR subnets CNTLM is accessible from.
# Items other than 127.0.0.1 are only effective if gateway_enabled is set to `yes`.
# Items other than 127.0.0.1 are only effective if gateway_enabled is set to `true`.
cntlm_allows:
- "127.0.0.1"

# If "yes", include the default ansible_default_ipv4 IP in cntlm_allows ([inventory_hostname]['ansible_default_ipv4'] )
cntlm_allows_include_local_ipv4: no
# If "true", include the default ansible_default_ipv4 IP in cntlm_allows ([inventory_hostname]['ansible_default_ipv4'] )
cntlm_allows_include_local_ipv4: false

# By default ("0/0"), CNTLM is inaccessible from all other IP addresses.
cntlm_denies:
- "0/0"

# If yes, access to CNTLM is possible from outside of the local host, subject to cntlm_allows and cntlm_denies:
gateway_enabled: no
# If true, access to CNTLM is possible from outside of the local host, subject to cntlm_allows and cntlm_denies:
gateway_enabled: false
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- name: Systemctl daemon-reload
ansible.builtin.systemd:
daemon_reload: yes
daemon_reload: true
notify:
- Restart software

Expand All @@ -28,7 +28,7 @@
owner: root
group: root
mode: 0755
remote_src: yes
remote_src: true

- name: Configure cntlm.conf
ansible.builtin.template:
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: ansible-role-cntlm
4 changes: 2 additions & 2 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

roles:
- role: robertdebock.bootstrap
Expand Down
6 changes: 3 additions & 3 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
- name: Verify
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

tasks:
- name: Try to use cntlm
ansible.builtin.shell:
cmd: echo "some_string" | cntlm -H
changed_when: no
changed_when: false
28 changes: 14 additions & 14 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- cntlm_version is defined
- cntlm_version is string
- cntlm_version is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_release
ansible.builtin.assert:
Expand All @@ -15,47 +15,47 @@
- cntlm_release is number
- cntlm_release
- cntlm_release > 0
quiet: yes
quiet: true

- name: assert | Test cntlm_download_mirror
ansible.builtin.assert:
that:
- cntlm_download_mirror is defined
- cntlm_download_mirror is string
- cntlm_download_mirror is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_username
ansible.builtin.assert:
that:
- cntlm_username is defined
- cntlm_username is string
- cntlm_username is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_password
ansible.builtin.assert:
that:
- cntlm_password is defined
- cntlm_password is string
- cntlm_password is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_domain
ansible.builtin.assert:
that:
- cntlm_domain is defined
- cntlm_domain is string
- cntlm_domain is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_proxy
ansible.builtin.assert:
that:
- cntlm_proxy is defined
- cntlm_proxy is string
- cntlm_proxy is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_listen
ansible.builtin.assert:
Expand All @@ -64,48 +64,48 @@
- cntlm_listen is number
- cntlm_listen > 0
- cntlm_listen < 65536
quiet: yes
quiet: true

- name: assert | Test cntlm_noproxy
ansible.builtin.assert:
that:
- cntlm_noproxy is defined
- cntlm_noproxy is string
- cntlm_noproxy is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_tmp
ansible.builtin.assert:
that:
- cntlm_tmp is defined
- cntlm_tmp is string
- cntlm_tmp is not none
quiet: yes
quiet: true

- name: assert | Test cntlm_allows
ansible.builtin.assert:
that:
- cntlm_allows is defined
- cntlm_allows is iterable
quiet: yes
quiet: true

- name: assert | Test cntlm_denies
ansible.builtin.assert:
that:
- cntlm_denies is defined
- cntlm_denies is iterable
quiet: yes
quiet: true

- name: assert | Test gateway_enabled
ansible.builtin.assert:
that:
- gateway_enabled is defined
- gateway_enabled is boolean
quiet: yes
quiet: true

- name: assert | Test cntlm_allows_include_local_ipv4
ansible.builtin.assert:
that:
- cntlm_allows_include_local_ipv4 is defined
- cntlm_allows_include_local_ipv4 is boolean
quiet: yes
quiet: true
18 changes: 9 additions & 9 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: Import assert.yml
ansible.builtin.import_tasks:
file: assert.yml
run_once: yes
run_once: true
delegate_to: localhost

- name: Install requirements
Expand All @@ -16,13 +16,13 @@
ansible.builtin.set_fact:
cntlm_allows: "{{ cntlm_allows + [hostvars[inventory_hostname]['ansible_default_ipv4']['address'] + '/32'] }}"
when:
- cntlm_allows_include_local_ipv4 == "yes"
- cntlm_allows_include_local_ipv4

- name: Unpack cntlm software
ansible.builtin.unarchive:
src: "{{ cntlm_sourceforge_mirror }}/{{ cntlm_archive }}"
dest: "{{ cntlm_tmp }}"
remote_src: yes
remote_src: true
mode: "0755"
when:
- ansible_pkg_mgr not in [ "apt", "yum", "dnf" ]
Expand All @@ -35,16 +35,16 @@
ansible.builtin.package:
name: cntlm
state: present
disable_gpg_check: yes
disable_gpg_check: true
when:
- ansible_pkg_mgr in [ "yum" ]

- name: Install cntlm software (dnf)
ansible.builtin.dnf:
name: "{{ cntlm_rpm_repository }}"
state: present
validate_certs: no
disable_gpg_check: yes
validate_certs: false
disable_gpg_check: true
when:
- ansible_pkg_mgr in [ "dnf" ]

Expand All @@ -57,7 +57,7 @@
url: "{{ cntlm_dpkg_repository }}"
dest: "{{ cntlm_tmp }}/cntlm_{{ cntlm_version }}_amd64.deb"
mode: "0640"
validate_certs: no
validate_certs: false

- name: Install cntlm software (apt)
ansible.builtin.apt:
Expand All @@ -80,7 +80,7 @@
creates: /etc/cntlm.hash
executable: /bin/bash
register: cntlm_generate_hash
check_mode: no
check_mode: false
notify:
- Configure cntlm.conf
when:
Expand All @@ -90,4 +90,4 @@
ansible.builtin.service:
name: cntlm
state: started
enabled: yes
enabled: true

0 comments on commit 1c87de7

Please sign in to comment.