Skip to content

Commit

Permalink
Merge pull request #14 from Oefenweb/consistency-changes
Browse files Browse the repository at this point in the history
Consistency changes
  • Loading branch information
tersmitten authored Aug 23, 2023
2 parents 0182da6 + 0e20a99 commit ce75e54
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
warn_list:
- role-name
- name[play]
- name[casing]
- '306'
- no-handler
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install ansible-lint[community,yamllint]
run: |
pip install ansible-lint
ansible-galaxy install -r requirements.yml
- name: Lint code
run: |
Expand All @@ -43,11 +45,8 @@ jobs:
matrix:
include:
- distro: debian8
ansible-version: '<2.10'
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.9, <2.10'
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
Expand All @@ -66,7 +65,7 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker
run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker

- name: Run Molecule tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true
pre_tasks:
- name: include variables
include_vars: "{{ item }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution_release }}.yml"
- "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution | lower }}.yml"
Expand Down
42 changes: 21 additions & 21 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: install dependencies
apt:
ansible.builtin.apt:
name: "{{ pip_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
Expand All @@ -12,7 +12,7 @@
- pip-dependencies

- name: create (download) directory
file:
ansible.builtin.file:
path: "{{ pip_download_path }}"
state: directory
owner: root
Expand All @@ -23,8 +23,8 @@
- pip
- pip-directory

- name: get python version
shell: >
- name: get python version # noqa risky-shell-pipe
ansible.builtin.shell: >
python{{ pip_python_version_major | string }} --version 2>&1 | awk '{print $2}'
register: _python_version
changed_when: false
Expand All @@ -33,69 +33,68 @@
- pip
- pip-get-python-version

- block:

- name: get download url
tags:
- configuration
- pip
- pip-get-download-url
block:
- name: get download url (2.6)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/2.6/get-pip.py'
when:
- _python_version.stdout is version('2.6', '>=')
- _python_version.stdout is version('2.7', '<')

- name: get download url (2.7)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/2.7/get-pip.py'
when:
- _python_version.stdout is version('2.7', '>=')
- _python_version.stdout is version('2.8', '<')

- name: get download url (3.2)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.2/get-pip.py'
when:
- _python_version.stdout is version('3.2', '>=')
- _python_version.stdout is version('3.3', '<')

- name: get download url (3.3)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.3/get-pip.py'
when:
- _python_version.stdout is version('3.3', '>=')
- _python_version.stdout is version('3.4', '<')

- name: get download url (3.4)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.4/get-pip.py'
when:
- _python_version.stdout is version('3.4', '>=')
- _python_version.stdout is version('3.5', '<')

- name: get download url (3.5)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.5/get-pip.py'
when:
- _python_version.stdout is version('3.5', '>=')
- _python_version.stdout is version('3.6', '<')

- name: get download url (3.6)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/3.6/get-pip.py'
when:
- _python_version.stdout is version('3.6', '>=')
- _python_version.stdout is version('3.7', '<')

- name: get download url (latest)
set_fact:
ansible.builtin.set_fact:
pip_download_url: 'https://bootstrap.pypa.io/pip/get-pip.py'
when: _python_version.stdout is version('3.7', '>=')

tags:
- configuration
- pip
- pip-get-download-url

- name: download (latest) pip
get_url:
ansible.builtin.get_url:
url: "{{ pip_download_url }}"
dest: "{{ pip_download_path }}/{{ pip_download_url | basename }}-{{ pip_python_version_major | string }}"
owner: root
Expand All @@ -109,9 +108,10 @@
- pip-pip-download

- name: install (latest) pip (setuptools and wheel)
command: >
ansible.builtin.command: >
python{{ pip_python_version_major | string }} {{ _download_latest.dest }}
when: _download_latest is changed
changed_when: true
tags:
- configuration
- pip
Expand Down
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
become: true
pre_tasks:
- name: include variables
include_vars: "{{ item }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/_{{ ansible_distribution_release }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_distribution | lower }}.yml"
Expand Down
2 changes: 1 addition & 1 deletion tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
become: true
pre_tasks:
- name: include variables
include_vars: "{{ item }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/_{{ ansible_distribution_release }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_distribution | lower }}.yml"
Expand Down

0 comments on commit ce75e54

Please sign in to comment.