Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistency changes #4

Merged
merged 3 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
warn_list:
- role-name
- name[play]
- name[casing]
- '306'
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,6 +4,6 @@
become: true
pre_tasks:
- name: include vars
include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
ansible.builtin.include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
roles:
- ../../../
2 changes: 1 addition & 1 deletion molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
become: true
tasks:
- name: include tasks
include: "{{ playbook_dir }}/../../tests/tasks/pre.yml"
ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/pre.yml"
4 changes: 2 additions & 2 deletions tasks/download.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: create (download) directory
file:
ansible.builtin.file:
path: "{{ phpmemcachedadmin_download_path }}"
state: directory
owner: root
Expand All @@ -11,7 +11,7 @@
- phpmemcachedadmin-download-directory

- name: download
get_url:
ansible.builtin.get_url:
url: "{{ phpmemcachedadmin_download_url }}"
dest: "{{ phpmemcachedadmin_download_path }}/{{ phpmemcachedadmin_download_url | basename }}"
owner: root
Expand Down
14 changes: 7 additions & 7 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: create (install) directory
file:
ansible.builtin.file:
path: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}"
state: directory
owner: root
Expand All @@ -13,7 +13,7 @@
- phpmemcachedadmin-install-directory

- name: install
unarchive:
ansible.builtin.unarchive:
src: "{{ phpmemcachedadmin_download_path }}/{{ phpmemcachedadmin_download_url | basename }}"
dest: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}"
creates: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}/index.php"
Expand All @@ -23,8 +23,8 @@
tags:
- phpmemcachedadmin-install-unarchive

- name: set file permissions
shell: >
- name: set file permissions # noqa risky-shell-pipe
ansible.builtin.shell: >
find . -type f ! -perm 0644 -print0 | xargs --no-run-if-empty -0 chmod -c 0644
args:
chdir: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}"
Expand All @@ -35,8 +35,8 @@
tags:
- phpmemcachedadmin-install-file-permissions

- name: set dir permissions
shell: >
- name: set dir permissions # noqa risky-shell-pipe
ansible.builtin.shell: >
find . -type d ! -perm 0755 -print0 | xargs --no-run-if-empty -0 chmod -c 0755
args:
chdir: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}"
Expand All @@ -48,7 +48,7 @@
- phpmemcachedadmin-install-dir-permissions

- name: set file owner and group
file:
ansible.builtin.file:
path: "{{ item.0.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}/{{ item.1 }}"
owner: "{{ item.0.owner }}"
group: "{{ item.0.group | default(item.0.owner) }}"
Expand Down
9 changes: 6 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# tasks file
---
- include: download.yml
- name: download
ansible.builtin.import_tasks: download.yml
tags:
- configuration
- phpmemcachedadmin
- phpmemcachedadmin-download

- include: install.yml
- name: install
ansible.builtin.import_tasks: install.yml
tags:
- configuration
- phpmemcachedadmin
- phpmemcachedadmin-install

- include: remove.yml
- name: remove
ansible.builtin.import_tasks: remove.yml
tags:
- configuration
- phpmemcachedadmin
Expand Down
2 changes: 1 addition & 1 deletion tasks/remove.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: remove
file:
ansible.builtin.file:
path: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}"
state: absent
with_items: "{{ phpmemcachedadmin_install_dirs }}"
Expand Down
2 changes: 1 addition & 1 deletion tests/tasks/pre.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pre test file
---
- name: create user (if needed)
user:
ansible.builtin.user:
name: dummy
4 changes: 2 additions & 2 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
become: true
pre_tasks:
- name: include vars
include_vars: "{{ playbook_dir }}/vars/main.yml"
ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml"
- name: include tasks
include: "{{ playbook_dir }}/tasks/pre.yml"
ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml"
roles:
- ../../
4 changes: 2 additions & 2 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
become: true
pre_tasks:
- name: include vars
include_vars: "{{ playbook_dir }}/vars/main.yml"
ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml"
- name: include tasks
include: "{{ playbook_dir }}/tasks/pre.yml"
ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml"
roles:
- ../../
2 changes: 1 addition & 1 deletion tests/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ phpmemcachedadmin_install_dirs:
owner: dummy
- dest: /tmp2
owner: dummy
group: root
ansible.builtin.group: root
- dest: /tmp3
state: absent