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 May 15, 2023
2 parents 9292c33 + 8d2c28f commit eedd095
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 26 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
warn_list:
- role-name
- name[play]
- name[casing]
8 changes: 4 additions & 4 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 @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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'
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/verify.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/post.yml"
ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/post.yml"
4 changes: 2 additions & 2 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tasks/install.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: "{{ rstudio_server_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 }}"
Expand Down
4 changes: 2 additions & 2 deletions tests/tasks/post.yml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit eedd095

Please sign in to comment.