Skip to content

Commit

Permalink
Fix multiple lint errors
Browse files Browse the repository at this point in the history
- fqcn: Use FQCN for module actions
- name: Jinja templates should only be at the end of 'name'
- no-shorthand: Avoid using shorthand (free-form) when calling module actions
  • Loading branch information
martignoni committed Oct 2, 2022
1 parent a8c8e11 commit 74df8b7
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion roles/accesspoint/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
register: access_point_mode_packages_installed
until: access_point_mode_packages_installed is succeeded

- name: Configure dhcpcd with static IP address {{ moodlebox_ip_address | ansible.utils.ipaddr('host') }}
- name: Configure dhcpcd with static IP address
ansible.builtin.blockinfile:
path: '/etc/dhcpcd.conf'
block: |
Expand Down
2 changes: 1 addition & 1 deletion roles/cron/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
register: direvent_configured

- name: Configure cron mailto variable to suppress warnings in log
cronvar:
community.general.cronvar:
name: MAILTO
value: '""'
2 changes: 1 addition & 1 deletion roles/database/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
register: pymysql_installed
until: pymysql_installed is succeeded

- name: Add '{{ moodlebox_db_username }}' MariaDB user with all privileges
- name: Add MariaDB user with all privileges
community.mysql.mysql_user:
name: '{{ moodlebox_db_username }}'
password: '{{ moodlebox_db_password }}'
Expand Down
2 changes: 1 addition & 1 deletion roles/hostname/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Change hostname to '{{ moodlebox_hostname }}'
- name: Change hostname
ansible.builtin.hostname:
name: '{{ moodlebox_hostname }}'
notify:
Expand Down
2 changes: 1 addition & 1 deletion roles/moodledatabase/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Create database '{{ moodlebox_moodle_db }}' for Moodle
- name: Create database for Moodle
community.mysql.mysql_db:
name: '{{ moodlebox_moodle_db }}'
login_unix_socket: '/var/run/mysqld/mysqld.sock'
Expand Down
43 changes: 22 additions & 21 deletions roles/moodleinstall/tasks/coreinstall.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Get Moodle version '{{ moodlebox_moodle_branch }}' from git repository
- name: Get Moodle from git repository
ansible.builtin.git:
repo: 'git://git.moodle.org/moodle.git'
version: '{{ moodlebox_moodle_branch }}'
Expand All @@ -23,7 +23,7 @@
- '/var/cache/moodle'
- '/var/cache/moodle-cache-backup'

- name: Set SGID permission on Moodle data '{{ moodlebox_moodle_data_dir }}' directory
- name: Set SGID permission on Moodle data directory
ansible.builtin.file:
path: '{{ moodlebox_moodle_data_dir }}'
state: 'directory'
Expand Down Expand Up @@ -63,25 +63,26 @@

# https://github.com/HCPSS/ansible-role-moodle/blob/master/tasks/install.yml
- name: Install Moodle via CLI
ansible.builtin.command: '/usr/bin/php "{{ moodlebox_moodle_source_dir }}/admin/cli/install.php"
--lang="{{ moodlebox_moodle_lang }}"
--wwwroot="http://{{ moodlebox_hostname }}.{{ moodlebox_tld }}"
--dataroot="{{ moodlebox_moodle_data_dir }}"
--dbtype="mariadb"
--dbname="{{ moodlebox_moodle_db }}"
--prefix="{{ moodlebox_moodle_db_prefix }}"
--dbuser="{{ moodlebox_db_username }}"
--dbpass="{{ moodlebox_db_password }}"
--fullname="{{ moodlebox_moodle_name }}"
--shortname="{{ moodlebox_moodle_name }}"
--summary="{{ moodlebox_moodle_summary }}"
--adminuser="{{ moodlebox_moodle_username }}"
--adminpass="{{ moodlebox_moodle_password }}"
--adminemail="{{ moodlebox_moodle_username }}@{{ moodlebox_hostname }}.invalid"
--non-interactive
--allow-unstable
--agree-license'
args:
ansible.builtin.command:
cmd: >
/usr/bin/php "{{ moodlebox_moodle_source_dir }}/admin/cli/install.php"
--lang="{{ moodlebox_moodle_lang }}"
--wwwroot="http://{{ moodlebox_hostname }}.{{ moodlebox_tld }}"
--dataroot="{{ moodlebox_moodle_data_dir }}"
--dbtype="mariadb"
--dbname="{{ moodlebox_moodle_db }}"
--prefix="{{ moodlebox_moodle_db_prefix }}"
--dbuser="{{ moodlebox_db_username }}"
--dbpass="{{ moodlebox_db_password }}"
--fullname="{{ moodlebox_moodle_name }}"
--shortname="{{ moodlebox_moodle_name }}"
--summary="{{ moodlebox_moodle_summary }}"
--adminuser="{{ moodlebox_moodle_username }}"
--adminpass="{{ moodlebox_moodle_password }}"
--adminemail="{{ moodlebox_moodle_username }}@{{ moodlebox_hostname }}.invalid"
--non-interactive
--allow-unstable
--agree-license
chdir: '{{ moodlebox_moodle_source_dir }}'
creates: '{{ moodlebox_moodle_source_dir }}/config.php'

Expand Down
10 changes: 7 additions & 3 deletions roles/moodleinstall/tasks/mathjax.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Get MathJax library version '{{ moodlebox_mathjax_version }}' from git repository
- name: Get MathJax library from git repository
ansible.builtin.git:
repo: 'https://github.com/mathjax/MathJax.git'
dest: '{{ moodlebox_moodle_source_dir }}/lib/MathJax'
Expand All @@ -17,7 +17,11 @@
recurse: 'yes'

- name: Change MathJax library URL
ansible.builtin.command: >
{{ moodle_config_cmd }} --component=filter_mathjaxloader --name=httpsurl --set=/lib/MathJax/MathJax.js
ansible.builtin.command:
cmd: >
{{ moodle_config_cmd }}
--component=filter_mathjaxloader
--name=httpsurl
--set=/lib/MathJax/MathJax.js
register: mathjax_url_result
changed_when: 'mathjax_url_result.rc == 0'
2 changes: 1 addition & 1 deletion roles/moodleinstall/tasks/moodleboxplugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Get MoodleBox plugin version '{{ moodlebox_moodlebox_plugin_version }}' from git repository
- name: Get MoodleBox plugin from git repository
ansible.builtin.git:
repo: 'https://github.com/moodlebox/moodle-tool_moodlebox.git'
dest: '{{ moodlebox_moodle_source_dir }}/admin/tool/moodlebox'
Expand Down
2 changes: 1 addition & 1 deletion roles/timezone/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Set timezone to '{{ moodlebox_timezone }}'
- name: Set timezone
ansible.builtin.file:
src: '/usr/share/zoneinfo/{{ moodlebox_timezone }}'
path: '/etc/localtime'
Expand Down

0 comments on commit 74df8b7

Please sign in to comment.