diff --git a/.ansible-lint b/.ansible-lint index 7e0172a..b04781e 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,4 +1,5 @@ --- warn_list: - role-name + - name[play] - name[casing] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38e0c38..ec785d8 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: | @@ -44,8 +46,6 @@ jobs: include: - distro: debian9 - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.9, <2.10' - distro: ubuntu1604 ansible-version: '>=2.10, <2.11' - distro: ubuntu1604 @@ -64,7 +64,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/README.md b/README.md index 5e59af6..9842a6f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Set up (the latest version of) [RStudio Server](https://www.rstudio.com/products #### Variables -* `rstudio_server_version` [default: `2022.02.2-485`]: Version to install +* `rstudio_server_version` [default: `2023.03.1-446`]: Version to install * `rstudio_server_install` [default: `[]`]: Additional packages to install (e.g. `r-base`) * `rstudio_server_www_port` [default: `8787`]: The port you want RStudio to listen on diff --git a/defaults/main.yml b/defaults/main.yml index 261b146..c3c62ec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ # defaults file --- -rstudio_server_version: '2022.02.2-485' +rstudio_server_version: '2023.03.1-446' rstudio_server_install: [] rstudio_server_www_port: 8787 diff --git a/handlers/main.yml b/handlers/main.yml index acc010d..1cb2bfc 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,7 @@ # handlers file --- - name: restart rstudio-server - service: + ansible.builtin.service: name: rstudio-server state: restarted when: service_default_state | default('started') == 'started' diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 73043c4..8596f09 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -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: - ../../../ diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index edfe900..3f1ea7a 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -4,4 +4,4 @@ become: true tasks: - name: include tasks - include: "{{ playbook_dir }}/../../tests/tasks/post.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/post.yml" diff --git a/tasks/configure.yml b/tasks/configure.yml index 390fba3..e84085b 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,7 +1,7 @@ # tasks file --- - name: configure | update (server) configuration file - template: + ansible.builtin.template: src: etc/rstudio/rserver.conf.j2 dest: /etc/rstudio/rserver.conf owner: root @@ -12,7 +12,7 @@ - rstudio-server-configure-server - name: configure | update (session) configuration file - template: + ansible.builtin.template: src: etc/rstudio/rsession.conf.j2 dest: /etc/rstudio/rsession.conf owner: root diff --git a/tasks/install.yml b/tasks/install.yml index f23dbca..14e178c 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,7 +1,7 @@ # tasks file --- - name: install | dependencies - apt: + ansible.builtin.apt: name: "{{ rstudio_server_dependencies }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -10,14 +10,14 @@ - rstudio-server-install-dependencies - name: install | additional - apt: + ansible.builtin.apt: name: "{{ rstudio_server_install }}" state: "{{ apt_install_state | default('latest') }}" tags: - rstudio-server-install-additional - name: install | create (download) directory - file: + ansible.builtin.file: path: "{{ rstudio_server_downloads_path }}" state: directory owner: root @@ -28,7 +28,7 @@ - rstudio-server-install-download-directory - name: install | download deb # noqa command-instead-of-module - command: > + ansible.builtin.command: > curl --silent --show-error --fail --location {{ rstudio_server_download_url }} -o {{ rstudio_server_downloads_path }}/rstudio-server-{{ rstudio_server_version }}-{{ rstudio_server_machine_map[ansible_machine] }}.deb @@ -39,7 +39,7 @@ - rstudio-server-install-download-deb - name: install | install deb - apt: + ansible.builtin.apt: deb: "{{ rstudio_server_downloads_path }}/rstudio-server-{{ rstudio_server_version }}-{{ rstudio_server_machine_map[ansible_machine] }}.deb" tags: - rstudio-server-install-install diff --git a/tasks/main.yml b/tasks/main.yml index d69f572..3b8d22a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ # tasks file --- - name: include variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "_{{ ansible_distribution_release }}.yml" - "_{{ ansible_distribution | lower }}.yml" @@ -11,20 +11,22 @@ - rstudio-server - rstudio-server-include-variables -- include: install.yml +- name: install + ansible.builtin.import_tasks: install.yml tags: - configuration - rstudio-server - rstudio-server-install -- include: configure.yml +- name: configure + ansible.builtin.import_tasks: configure.yml tags: - configuration - rstudio-server - rstudio-server-configure - name: start and enable service - service: + ansible.builtin.service: name: rstudio-server state: "{{ service_default_state | default('started') }}" enabled: "{{ service_default_enabled | default(true) | bool }}" diff --git a/tests/tasks/post.yml b/tests/tasks/post.yml index 8176e61..55405aa 100644 --- a/tests/tasks/post.yml +++ b/tests/tasks/post.yml @@ -1,13 +1,13 @@ # post test file --- - name: install test dependencies - apt: + ansible.builtin.apt: name: - wget state: "{{ apt_install_state | default('latest') }}" - name: test rstudio-server installation # noqa command-instead-of-module - shell: > + ansible.builtin.shell: > wget http://localhost:8787/auth-sign-in -O /dev/null -S --quiet 2>&1 | grep -q '200 OK' && (echo 'Availability test: pass' && exit 0) diff --git a/tests/test.yml b/tests/test.yml index 3c9a06c..7104ff2 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,9 +5,9 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" roles: - ../../ post_tasks: - name: include tasks - include: "{{ playbook_dir }}/tasks/post.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/post.yml" diff --git a/tests/vagrant.yml b/tests/vagrant.yml index e3f8baf..63e7d4f 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,9 +5,9 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" roles: - ../../ post_tasks: - name: include tasks - include: "{{ playbook_dir }}/tasks/post.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/post.yml"