-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.yml
48 lines (42 loc) · 1.29 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
# tasks file for moodle
- name: Import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: true
delegate_to: localhost
- name: Install requirements
ansible.builtin.package:
name: "{{ moodle_requirements }}"
state: present
- name: Download and unpack moodle
ansible.builtin.unarchive:
src: "{{ moodle_src }}"
dest: "{{ moodle_httpd_data_directory }}"
creates: "{{ moodle_httpd_data_directory }}/moodle"
remote_src: true
owner: "{{ moodle_httpd_owner }}"
group: "{{ moodle_httpd_group }}"
mode: "0755"
register: moodle_download_and_unpack
until:
- moodle_download_and_unpack is succeeded
retries: 3
- name: Make directory
ansible.builtin.file:
path: "{{ moodle_data_directory }}"
state: directory
owner: "{{ moodle_httpd_owner }}"
group: "{{ moodle_httpd_group }}"
mode: "{{ moodle_directory_mode }}"
- name: Configure moodle
ansible.builtin.template:
src: config.php.j2
dest: "{{ moodle_httpd_data_directory }}/moodle/config.php"
owner: "{{ moodle_httpd_owner }}"
group: "{{ moodle_httpd_group }}"
mode: "0640"
- name: Setup cron job
ansible.builtin.cron:
name: moodle
job: "/usr/bin/php {{ moodle_httpd_data_directory }}/moodle/admin/cli/cron.php >/dev/null"
user: "{{ moodle_httpd_owner }}"