diff --git a/.github/workflows/ansible-alpine-latest.yml b/.github/workflows/ansible-alpine-latest.yml deleted file mode 100644 index 96ccfd1..0000000 --- a/.github/workflows/ansible-alpine-latest.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check alpine:latest - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with alpine:latest' - uses: roles-ansible/check-ansible-alpine-latest-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-archlinux-latest.yml b/.github/workflows/ansible-archlinux-latest.yml deleted file mode 100644 index edcd8c8..0000000 --- a/.github/workflows/ansible-archlinux-latest.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check archlinux:latest - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with archlinux:latest' - uses: roles-ansible/check-ansible-archlinux-latest-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-centos-centos7.yml b/.github/workflows/ansible-centos-centos7.yml deleted file mode 100644 index f7990c9..0000000 --- a/.github/workflows/ansible-centos-centos7.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check centos:centos7 - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with ubuntu:centos7' - uses: roles-ansible/check-ansible-centos-centos7-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-centos-centos8.yml b/.github/workflows/ansible-centos-centos8.yml deleted file mode 100644 index 5dc597e..0000000 --- a/.github/workflows/ansible-centos-centos8.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check centos:centos8 - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with ubuntu:centos8' - uses: roles-ansible/check-ansible-centos-centos8-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-centos-centos9.yml b/.github/workflows/ansible-centos-centos9.yml deleted file mode 100644 index 4e95a06..0000000 --- a/.github/workflows/ansible-centos-centos9.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check centos:stream9 - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with quay.io/centos/centos:stream9' - uses: roles-ansible/check-ansible-centos-centos9-action@main - with: - targets: "./" diff --git a/.github/workflows/ansible-centos-latest.yml b/.github/workflows/ansible-centos-latest.yml deleted file mode 100644 index 16bb4e7..0000000 --- a/.github/workflows/ansible-centos-latest.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check centos:latest - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with ubuntu:latest' - uses: roles-ansible/check-ansible-centos-latest-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-debian-bullseye.yml b/.github/workflows/ansible-debian-bullseye.yml deleted file mode 100644 index b50d111..0000000 --- a/.github/workflows/ansible-debian-bullseye.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check debian:bullseye - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with debian:bullseye' - uses: roles-ansible/check-ansible-debian-bullseye-action@main - with: - targets: "./" diff --git a/.github/workflows/ansible-debian-buster.yml b/.github/workflows/ansible-debian-buster.yml deleted file mode 100644 index a819e89..0000000 --- a/.github/workflows/ansible-debian-buster.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check debian:buster - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with debian:buster' - uses: roles-ansible/check-ansible-debian-buster-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-debian-latest.yml b/.github/workflows/ansible-debian-latest.yml deleted file mode 100644 index d06a132..0000000 --- a/.github/workflows/ansible-debian-latest.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check debian:latest - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with debian:latest' - uses: roles-ansible/check-ansible-debian-latest-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-debian-sid.yml b/.github/workflows/ansible-debian-sid.yml deleted file mode 100644 index 22cbbfb..0000000 --- a/.github/workflows/ansible-debian-sid.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check debian:sid - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with debian:sid' - uses: roles-ansible/check-ansible-debian-sid-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-debian-stable.yml b/.github/workflows/ansible-debian-stable.yml deleted file mode 100644 index bf06f77..0000000 --- a/.github/workflows/ansible-debian-stable.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Ansible check debian:stable - -# yamllint disable-line rule:truthy -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with debian:stable' - uses: roles-ansible/check-ansible-debian-stable-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-debian-stretch.yml b/.github/workflows/ansible-debian-stretch.yml deleted file mode 100644 index c291320..0000000 --- a/.github/workflows/ansible-debian-stretch.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check debian:stretch - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with debian:stretch' - uses: roles-ansible/check-ansible-debian-stretch-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-fedora-31.yml b/.github/workflows/ansible-fedora-31.yml deleted file mode 100644 index 707e816..0000000 --- a/.github/workflows/ansible-fedora-31.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check fedora:31 - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with fedora:31' - uses: roles-ansible/check-ansible-fedora-31-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-fedora-32.yml b/.github/workflows/ansible-fedora-32.yml deleted file mode 100644 index 4376180..0000000 --- a/.github/workflows/ansible-fedora-32.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check fedora:32 - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with fedora:32' - uses: roles-ansible/check-ansible-fedora-32-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-fedora-33.yml b/.github/workflows/ansible-fedora-33.yml deleted file mode 100644 index e2809ba..0000000 --- a/.github/workflows/ansible-fedora-33.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check fedora:33 - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with fedora:33' - uses: roles-ansible/check-ansible-fedora-33-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-fedora-latest.yml b/.github/workflows/ansible-fedora-latest.yml deleted file mode 100644 index 78fa27f..0000000 --- a/.github/workflows/ansible-fedora-latest.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check fedora:latest - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with fedora:latest' - uses: roles-ansible/check-ansible-fedora-latest-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 4d7dc8e..e304fa0 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -2,21 +2,22 @@ name: Ansible Lint check # yamllint disable-line rule:truthy -on: - push: - branches: '*' - pull_request: - branches: '*' +on: [push, pull_request] jobs: build: + name: Ansible Lint runs-on: ubuntu-latest steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'Lint Ansible Playbook' - uses: ansible/ansible-lint-action@v6 + - name: Checkout git repo + uses: actions/checkout@v4 with: - targets: "." + submodules: true + fetch-depth: 0 + + - name: Run ansible-lint + uses: ansible-actions/ansible-lint-action@v1.0.2 + with: + target: "./" + collections_yml: 'requirements.yml' diff --git a/.github/workflows/ansible-ubuntu-bionic.yml b/.github/workflows/ansible-ubuntu-bionic.yml deleted file mode 100644 index 0b07870..0000000 --- a/.github/workflows/ansible-ubuntu-bionic.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check ubuntu:bionic - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'ansible check with ubuntu:bionic' - uses: roles-ansible/check-ansible-ubuntu-bionic-action@master - with: - targets: "./" diff --git a/.github/workflows/ansible-ubuntu-latest.yml b/.github/workflows/ansible-ubuntu-latest.yml deleted file mode 100644 index 583b6ad..0000000 --- a/.github/workflows/ansible-ubuntu-latest.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Ansible check ubuntu:latest - -# yamllint disable-line rule:truthy -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: ansible check with ubuntu:latest - uses: roles-ansible/check-ansible-ubuntu-latest-action@master - with: - targets: "./" diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index adcecbd..b44f94e 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -1,22 +1,24 @@ --- -name: Galaxy release +name: Galaxy-NG Roles Import # yamllint disable-line rule:truthy on: - push: - branches: ['main'] release: types: ['created'] jobs: build: + name: Galaxy Role Importer runs-on: ubuntu-latest - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - name: 'release on galaxy' - uses: robertdebock/galaxy-action@1.2.0 + steps: + - name: 'Checkout git repo' + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: 'Release on galaxy' + uses: ansible-actions/ansible-galaxy-action@v1.1.1 with: galaxy_api_key: ${{ secrets.galaxy_api_key }} - git_branch: 'main' diff --git a/.github/workflows/j2lint-check.yml b/.github/workflows/j2lint-check.yml new file mode 100644 index 0000000..00c7861 --- /dev/null +++ b/.github/workflows/j2lint-check.yml @@ -0,0 +1,22 @@ +--- +name: Jinja2 Linting check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + name: Jinja2 Linting + runs-on: ubuntu-latest + + steps: + - name: Checkout git repo + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Run j2lint + uses: ansible-actions/j2lint-action@v0.0.1 + with: + target: "./" diff --git a/.github/workflows/yamllint-check.yml b/.github/workflows/yamllint-check.yml new file mode 100644 index 0000000..5e62f57 --- /dev/null +++ b/.github/workflows/yamllint-check.yml @@ -0,0 +1,22 @@ +--- +name: Yamllint check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + name: Yamllint + runs-on: ubuntu-latest + + steps: + - name: Checkout git repo + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Run yamllint + uses: ansible-actions/yamllint-action@v0.0.1 + with: + target: "./" diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml deleted file mode 100644 index d744e9c..0000000 --- a/.github/workflows/yamllint.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: 'Yamllint GitHub Actions' - -# yamllint disable-line rule:truthy -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - yamllint: - name: 'Yamllint' - runs-on: ubuntu-latest - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'Yamllint' - uses: karancode/yamllint-github-action@v2.0.0 - with: - yamllint_file_or_dir: '.' - yamllint_config_filepath: './.yamllint' diff --git a/README.md b/README.md index 68a9ebd..9a6d1ea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![Ansible Galaxy](https://raw.githubusercontent.com/roles-ansible/ansible_role_ranger/master/.github/galaxy.svg?sanitize=true)](https://galaxy.ansible.com/do1jlr/ranger) [![MIT License](https://raw.githubusercontent.com/roles-ansible/ansible_role_ranger/master/.github/license.svg?sanitize=true)](https://github.com/roles-ansible/ansible_role_ranger/blob/master/LICENSE) - ansible_role_ranger ============== @@ -19,7 +18,6 @@ Ansible role to install the ranger file manager on linux. ranger is a console fi You can either use this role via ansible galaxy or use it directly from [this](https://github.com/roles-ansible/ansible_role_ranger.git) git repository. ### ansible galaxy - install role: ```bash ansible-galaxy install do1jlr.ranger @@ -39,9 +37,7 @@ Example Ansible-Playbook: - do1jlr.ranger ``` - ### use via git command - clone github repo: ```bash git clone https://github.com/roles-ansible/ansible_role_ranger.git @@ -59,39 +55,12 @@ example Playbook: submodules_versioncheck: true ``` - -## Testing -This role is tested with [these github-action](https://github.com/search?q=topic%3Acheck-ansible+topic%3Agithub-actions+org%3Aroles-ansible&type=Repositories) tests for different versions of differen linux systems. -If you want to find out more about our tests, please have a look at the github marketplace. - -| test status | Github Marketplace | -| :--------- | :---------------- | -| [![Galaxy release](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/galaxy.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/galaxy.yml) | [publish-ansible-role-to-galaxy](https://github.com/marketplace/actions/publish-ansible-role-to-galaxy) | -| [![Yamllint GitHub Actions](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/yamllint.yaml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/yamllint.yaml) | [yamllint-github-action](https://github.com/marketplace/actions/yamllint-github-action) | -| [![Ansible Lint check](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-linting-check.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-linting-check.yml) | [ansible-lint action](https://github.com/marketplace/actions/ansible-lint) -| [![Ansible check debian:latest](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-latest.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-latest.yml) | [ansible test with debian stable](https://github.com/marketplace/actions/check-ansible-debian-stable) | -| [![Ansible check debian:latest](https://github.com/roles-ansible/ansible_role_ranger/workflows/Ansible%20check%20debian:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions?query=workflow%3A%22Ansible+check+debian%3Alatest%22) | [ansible test with debian latest](https://github.com/marketplace/actions/check-ansible-debian-latest) | -| [![Ansible check debian:sid](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-sid.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-sid.yml) | [ansible test with debian sid](https://github.com/marketplace/actions/check-ansible-debian-sid) | -| [![Ansible check debian:stable](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-stable.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-stable.yml) | [ansible test with debian stable](https://github.com/marketplace/actions/check-ansible-debian-stable) | -| [![Ansible check debian:buster](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-buster.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-debian-buster.yml) | [ansible test with debian buster](https://github.com/marketplace/actions/check-ansible-debian-buster) | -| | | -| [![Ansible check archlinux:latest](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-archlinux-latest.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-archlinux-latest.yml) | [ansible test with archlinux latest](https://github.com/marketplace/actions/check-ansible-archlinux-latest) | -| | | -| [![Ansible check ubuntu:latest](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-ubuntu-latest.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-ubuntu-latest.yml) | [ansible test with ubuntu latest](https://github.com/marketplace/actions/check-ansible-ubuntu-latest) | -| [![Ansible check ubuntu:bionic](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-ubuntu-bionic.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-ubuntu-bionic.yml) | [ansible test with ubuntu bionic](https://github.com/marketplace/actions/check-ansible-ubuntu-bionic) | -| [![Ansible check ubuntu:trusty](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-ubuntu-trusty.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-ubuntu-trusty.yml) | [ansible test with ubuntu trusty](https://github.com/marketplace/actions/check-ansible-ubuntu-trusty) | -| | | -| [![Ansible check fedora:latest](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-latest.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-latest.yml) | [ansible test with fedora latest](https://github.com/marketplace/actions/check-ansible-fedora-latest) | -| [![Ansible check fedora:33](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-33.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-33.yml) | [ansible test with fedora 33](https://github.com/marketplace/actions/check-ansible-fedora-33) | -| [![Ansible check fedora:32](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-32.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-32.yml) | [ansible test with fedora 32](https://github.com/marketplace/actions/check-ansible-fedora-32) | -| [![Ansible check fedora:31](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-31.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-fedora-31.yml) | [ansible test with fedora 31](https://github.com/marketplace/actions/check-ansible-fedora-31) | -| | | -| [![Ansible check centos:latest](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-centos-latest.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-centos-latest.yml) | [ansible test with centos latest](https://github.com/marketplace/actions/check-ansible-centos-latest) | -| [![Ansible check centos:centos8](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-centos-centos8.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-centos-centos8.yml) | [ansible test with centos centos8](https://github.com/marketplace/actions/check-ansible-centos-centos8) | -| [![Ansible check centos:centos7](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-centos-centos7.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions/workflows/ansible-centos-centos7.yml) | [ansible test with centos centos7](https://github.com/marketplace/actions/check-ansible-centos-centos7) | -| | | -| [![Ansible check alpine:latest](https://github.com/roles-ansible/ansible_role_ranger/workflows/Ansible%20check%20alpine:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_ranger/actions?query=workflow%3A%22Ansible+check+alpine%3Alatest%22) | [ansible test with alpine latest](https://github.com/marketplace/actions/check-ansible-alpine-latest) | - +## Requirements +The ``community.general`` collection is required for some parts of this ansible role. +You can install it with this command: +```bash +ansible-galaxy collection install -r requirements.yml --upgrade +``` variables ------- diff --git a/meta/main.yml b/meta/main.yml index 94da760..553fc31 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -3,23 +3,25 @@ galaxy_info: author: do1jlr description: Ansible role to install the ranger file manager on linux. ranger is a console file manager with VI key bindings. role_name: ranger + namespace: l3d license: MIT - min_ansible_version: 2.8 + min_ansible_version: '2.13' github_branch: main platforms: - - name: Archlinux - versions: all + - name: ArchLinux + versions: ['all'] - name: Debian - versions: all + versions: ['all'] - name: Ubuntu - versions: all + versions: ['all'] - name: Fedora - versions: all + versions: ['all'] - name: EL - versions: all + versions: ['all'] galaxy_tags: - ranger - filemanager - cli - console + - linux dependencies: [] diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..a5a1e10 --- /dev/null +++ b/requirements.yml @@ -0,0 +1,4 @@ +--- +collections: + - name: 'community.general' + version: ">=7.5.0,<=8.0.0" diff --git a/tasks/compile_ranger.yml b/tasks/compile_ranger.yml index 4088e10..f145075 100644 --- a/tasks/compile_ranger.yml +++ b/tasks/compile_ranger.yml @@ -1,32 +1,31 @@ --- -- name: download ranger git repo +- name: Download ranger git repo ansible.builtin.git: repo: "{{ ranger.repo }}" dest: "{{ ranger.download_directory }}" version: "{{ ranger.branch }}" -- name: install build packages +- name: Install build packages become: true ansible.builtin.package: name: "{{ ranger__build_deps }}" - state: present + state: 'present' -- name: Run 'install' target as root +- name: Run 'install' target as root # noqa: H1901 become: true community.general.make: chdir: "{{ ranger.download_directory }}" - target: install + target: 'install' when: ansible_python_version[:1] == '3' -- name: install python3 +- name: Install python3 become: true ansible.builtin.package: - name: python3 - state: present + name: 'python3' + state: 'present' register: install_python3 - ignore_errors: true -- name: install ranger with python3 +- name: Install ranger with python3 become: true ansible.builtin.command: python3 setup.py install --optimize=1 args: @@ -34,16 +33,17 @@ creates: '/usr/local/bin/ranger' when: not install_python3.failed -- name: install legacy-python f00 +- name: Install legacy-python f00 become: true ansible.builtin.package: - name: - - python - - python-setuptools - state: present + name: "{{ item }}" + state: 'present' + loop: + - 'python' + - 'python-setuptools' when: install_python3.failed -- name: install ranger with legacy-python +- name: Install ranger with legacy-python become: true ansible.builtin.command: python setup.py install --optimize=1 args: diff --git a/tasks/main.yml b/tasks/main.yml index 7fcbf17..9f3d192 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,10 +1,11 @@ --- -- name: combine ranger configuration +- name: Combine ranger configuration ansible.builtin.set_fact: - ranger: "{{ _ranger|combine(ranger, recursive=True) }}" + ranger: "{{ _ranger | combine(ranger, recursive=True) }}" -- name: run optional versionscheck - ansible.builtin.include_tasks: versioncheck.yml +- name: Run optional versionscheck + ansible.builtin.include_tasks: + file: 'versioncheck.yml' when: submodules_versioncheck|bool - name: Update apt cache @@ -14,14 +15,14 @@ update_cache: true when: ansible_pkg_mgr == "apt" -- name: install ranger - become: true - ansible.builtin.package: - name: ranger - state: present - register: install_ranger - ignore_errors: true - -- name: compile ranger if install failed - ansible.builtin.include_tasks: compile_ranger.yml - when: install_ranger.failed +- name: Install ranger + block: + - name: Install ranger + become: true + ansible.builtin.package: + name: ranger + state: present + rescue: + - name: Compile ranger if regular install failed + ansible.builtin.include_tasks: + file: 'compile_ranger.yml' diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 5128cc8..7dd80c5 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -7,38 +7,38 @@ ansible.builtin.file: path: '/etc/.ansible-version' state: directory - mode: 0755 - when: submodules_versioncheck|bool + mode: '0755' + when: submodules_versioncheck | bool -- name: check playbook version +- name: Check playbook version become: true ansible.builtin.slurp: src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version - when: submodules_versioncheck|bool - ignore_errors: true + when: submodules_versioncheck | bool failed_when: false -- name: Print remote role version +- name: Print remote role version # noqa: H500 ansible.builtin.debug: msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool -- name: Print locale role version +- name: Print locale role version # noqa: H500 ansible.builtin.debug: - msg: "Local role version: '{{ playbook_version_number|string }}'." - when: submodules_versioncheck|bool + msg: "Local role version: '{{ playbook_version_number | string }}'." + when: submodules_versioncheck | bool - name: Check if your version is outdated ansible.builtin.fail: msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!" when: - - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool + - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool -- name: write new version to remote disk +- name: Write new version to remote disk become: true ansible.builtin.copy: content: "{{ playbook_version_number }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}" mode: '0644' - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool + tags: skip_ansible_lint_template-instead-of-copy diff --git a/vars/main.yml b/vars/main.yml index 6fa2476..a7c77b3 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,6 @@ --- # versionscheck -playbook_version_number: 1028 # should be int +playbook_version_number: 1029 # should be int playbook_version_path: 'role-ranger_roles-ansible_github.com.version' # variables for ranger