diff --git a/.ansible-lint b/.ansible-lint index 7e0172a..740e99a 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,4 +1,6 @@ --- warn_list: - role-name + - name[play] - name[casing] + - jinja[spacing] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 296f7cc..7e2bc34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | @@ -42,8 +44,9 @@ jobs: fail-fast: false matrix: include: - - distro: ubuntu1604 - ansible-version: '>=2.9, <2.10' + - distro: debian8 + - distro: debian9 + - distro: debian10 - distro: ubuntu1604 ansible-version: '>=2.10, <2.11' - distro: ubuntu1604 @@ -62,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: | diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 0837e25..fcb5495 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -4,7 +4,7 @@ become: true tasks: - name: test r installation - shell: > + ansible.builtin.shell: > Rscript -e 'print(gsub("I","O","PING"))' | grep -q 'PONG' && (echo 'Availability test: pass' && exit 0) diff --git a/tasks/install.yml b/tasks/install.yml index e28b6a9..8aab5f6 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,7 +1,7 @@ # tasks file --- - name: install | dependencies - apt: + ansible.builtin.apt: name: "{{ r_dependencies }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -10,7 +10,7 @@ - r-install-dependencies - name: install | additional - apt: + ansible.builtin.apt: name: "{{ r_install }}" state: "{{ apt_install_state | default('latest') }}" tags: diff --git a/tasks/main.yml b/tasks/main.yml index 061c29c..8b182e5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,18 +1,21 @@ # tasks file --- -- include: repository.yml +- name: repository + ansible.builtin.import_tasks: repository.yml tags: - configuration - r - r-repository -- include: install.yml +- name: install + ansible.builtin.import_tasks: install.yml tags: - configuration - r - r-install -- include: packages.yml +- name: packages + ansible.builtin.import_tasks: packages.yml tags: - configuration - r diff --git a/tasks/packages.yml b/tasks/packages.yml index da81deb..7d66240 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -1,7 +1,7 @@ # tasks file --- - name: packages | copy r scripts - template: + ansible.builtin.template: src: "{{ item.src }}" dest: "{{ r_scripts_install_path }}/{{ item.dest }}" owner: "{{ r_scripts_install_owner }}" @@ -23,25 +23,24 @@ tags: - r-packages-copy-r-scripts -- block: - +- name: installed packages + when: r_list_packages_once | bool + tags: + - r-packages-list-installed + block: - name: packages | list installed packages - command: > + ansible.builtin.command: > R-list-installed-packages {{ r_packages_lib }} environment: "{{ r_environment }}" register: _r_installed_packages changed_when: false - name: packages | set_fact list installed packages - set_fact: + ansible.builtin.set_fact: r_installed_packages: "{{ _r_installed_packages.stdout_lines }}" - when: r_list_packages_once | bool - tags: - - r-packages-list-installed - - name: packages | install - command: > + ansible.builtin.command: > {{ r_scripts_install_path }}/R-install-package {{ item.name }} {{ item.type | default(r_packages_type) }} @@ -63,7 +62,7 @@ - r-packages-install - name: packages | remove - command: > + ansible.builtin.command: > {{ r_scripts_install_path }}/R-remove-package {{ item.name }} {% if item.lib is defined %}{{ item.lib }}{% endif %} @@ -79,7 +78,7 @@ - r-packages-remove - name: packages | update - command: > + ansible.builtin.command: > {{ r_scripts_install_path }}/R-update-package {{ item.name }} {{ item.type | default(r_packages_type) }} diff --git a/tasks/repository.yml b/tasks/repository.yml index e2e4df4..4952355 100644 --- a/tasks/repository.yml +++ b/tasks/repository.yml @@ -1,7 +1,7 @@ # tasks file --- - name: repository | install dependencies (pre) - apt: + ansible.builtin.apt: name: "{{ r_dependencies_pre }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -10,7 +10,7 @@ - r-repository-install-dependencies - name: repository | add public key - apt_key: + ansible.builtin.apt_key: id: E298A3A825C0D65DFD57CBB651716619E084DAB9 keyserver: keyserver.ubuntu.com state: present @@ -18,7 +18,7 @@ - r-repository-public-key - name: repository | add cran-r - apt_repository: + ansible.builtin.apt_repository: repo: "{{ item.type }} {{ item.url }}" state: present update_cache: true