Skip to content

Commit

Permalink
refactor: switch back to using branches
Browse files Browse the repository at this point in the history
This is based on the Moodle Downloads page that states that stable branches are better for production than
tags.
  • Loading branch information
geoffreyvanwyk committed Jan 24, 2024
1 parent 5ddd0c8 commit bd2f8d4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
10 changes: 4 additions & 6 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ sandbox_email: info@learningsandbox.online
sandbox_github: https://github.com/geoffreyvanwyk/learningsandbox.online

sandbox_versions:
- version: "4.1"
tag: v4.1.8
- version: "4.2"
tag: v4.2.5
- version: "4.3"
tag: v4.3.2
- branch: MOODLE_401_STABLE
version: 4.1
- branch: MOODLE_402_STABLE
version: 4.2
4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
sandbox_domain_aliases: []
sandbox_environment: development
sandbox_versions:
- tag: v4.3.2
version: "4.3"
- branch: MOODLE_39_STABLE
version: 3.9

- name: Import main playbook
ansible.builtin.import_playbook: ../../main.playbook.yml
4 changes: 2 additions & 2 deletions molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
sandbox_domain_aliases: []
sandbox_environment: development
sandbox_versions:
- tag: v4.3.2
version: '4.3'
- branch: MOODLE_39_STABLE
version: 3.9

- name: Import reset playbook
ansible.builtin.import_playbook: ../../moodle_reset.playbook.yml
4 changes: 2 additions & 2 deletions molecule/uninstall/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
sandbox_domain_aliases: []
sandbox_environment: development
sandbox_versions:
- tag: v4.3.2
version: "4.3"
- branch: MOODLE_401_STABLE
version: 4.1

- name: Import uninstall playbook
ansible.builtin.import_playbook: ../../moodle_uninstall.playbook.yml
2 changes: 1 addition & 1 deletion molecule/uninstall/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ provisioner:
host_vars:
learningsandboxonline_molecule_${MOLECULE_DISTRO:-ubuntu2204}:
ansible_user: ubuntu
moodle_deploy_version: ${MOLECULE_MOODLE_VERSION:-v4.3.2}
moodle_deploy_version: ${MOLECULE_MOODLE_VERSION:-MOODLE_402_STABLE}
verifier:
name: ansible
4 changes: 2 additions & 2 deletions molecule/uninstall/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
sandbox_domain_aliases: []
sandbox_environment: development
sandbox_versions:
- tag: v4.3.2
version: "4.3"
- branch: MOODLE_400_STABLE
version: 4.0

- name: Import main playbook
ansible.builtin.import_playbook: ../../main.playbook.yml
2 changes: 1 addition & 1 deletion tasks/install_moodle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
ansible.builtin.include_role:
name: geoffreyvanwyk.moodle
vars:
moodle_deploy_version: "{{ sandbox_item.tag }}"
moodle_deploy_version: "{{ sandbox_item.branch }}"
moodle_deploy_destination: /var/www/html/moodle-{{ sandbox_item.version }}
moodle_deploy_update: no
moodle_web_protocol: https
Expand Down
7 changes: 4 additions & 3 deletions tasks/reset_moodle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
sandbox_moodledata: >-
/var/www/moodledata-{{ sandbox_domain }}-moodle-{{ sandbox_item.version }}
sandbox_php_version: "{{
'8.2' if (sandbox_item.version in ['4.3', '4.2'])
else '8.1' if (sandbox_item.version in ['4.1'])
else '8.0' if (sandbox_item.version in ['4.0', '3.11'])
'8.1' if (sandbox_item.branch == 'MOODLE_402_STABLE') or
(sandbox_item.branch == 'MOODLE_401_STABLE')
else '8.0' if (sandbox_item.branch == 'MOODLE_400_STABLE') or
(sandbox_item.branch == 'MOODLE_311_STABLE')
else '7.4' }}"

- name: Set dependent variables [{{ sandbox_item.version }}]
Expand Down

0 comments on commit bd2f8d4

Please sign in to comment.