1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/1-prep/tasks/computed_vars.yml

142 lines
3.9 KiB
YAML
Raw Normal View History

2017-05-27 18:09:50 +00:00
# get local vars from scripts in /etc/ansible/facts.d
# on first run, this will generate UUID
- name: re-read facts
setup: filter=ansible_local
# set top level variables from local facts for convenience
- set_fact:
xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}'
phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}'
- name: Set exFAT enabled for XOs
set_fact:
exFAT_enabled: True
when: xo_model != "none"
- name: add version section
ini_file: dest='{{ iiab_config_file }}'
2017-05-27 18:09:50 +00:00
section=runtime
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: 'runtime_branch'
value: '{{ ansible_local["local_facts"]["iiab_branch"] }}'
2017-05-27 18:09:50 +00:00
- option: 'runtime_commit'
value: '{{ ansible_local["local_facts"]["iiab_commit"] }}'
2017-05-27 18:09:50 +00:00
- option: 'runtime_date'
value: '{{ ansible_date_time["iso8601"] }}'
- option: 'runtime_php'
value: '{{ phplib_dir }}'
- option: 'kernel'
value: '{{ ansible_kernel }}'
- option: 'memory_mb'
value: '{{ ansible_memtotal_mb }}'
- option: 'swap_mb'
value: '{{ ansible_swaptotal_mb }}'
- option: 'product_id'
value: '{{ ansible_product_uuid }}'
# Put all computed vars here so derive properly from any prior var file
- name: If the TZ is not set in env, set it to UTC
set_fact: local_tz='UTC'
when: local_tz == ""
2017-05-27 18:09:50 +00:00
- name: Set port 80 for Admin Console
set_fact:
gui_port: 80
when: not adm_cons_force_ssl
- name: Set port 443 for Admin Console
set_fact:
gui_port: 443
when: adm_cons_force_ssl
- name: Turn on mysql if elgg or rachel enabled
set_fact:
mysql_install: True
mysql_enabled: True
# we decided to enable mysql unconditionally
# when: elgg_enabled or rachel_enabled or owncloud_enabled or phpmyadmin_enabled or wordpress_enabled or iiab_menu_install
- name: Turn on mongodb if sugarizer enabled
set_fact:
mongodb_install: True
mongodb_enabled: True
when: sugarizer_enabled
# There might be other db's
- name: Turn on postgresql if moodle or pathagar enabled
set_fact:
postgresql_install: True
postgresql_enabled: True
when: moodle_enabled or pathagar_enabled
- name: Turn on docker if schooltool is to be installed
set_fact:
docker_install: True
docker_enabled: True
when: schooltool_enabled or schooltool_install
- name: Set python_path for is_redhat
set_fact:
python_path: /usr/lib/python2.7/site-packages/
when: is_redhat
- name: Set python_path for is_debuntu
set_fact:
python_path: /usr/local/lib/python2.7/dist-packages/
when: is_debuntu
2017-05-27 18:09:50 +00:00
# for various reasons the mysql service can not be enabled on fedora 20,
# but 'mariadb', which is its real name can
# on fedora 18 we need to use 'mysqld'
- name: Set mysqld service name to mariadb by default
set_fact:
mysql_service: mariadb
- name: Set mysqld service name to mysqld for fedora 18
set_fact:
mysql_service: mysqld
no_NM_reload: True
is_F18: True
when: ansible_distribution_release == "based on Fedora 18" or ansible_distribution_version == "18"
- name: Set mysql service name to mysql for debian
set_fact:
mysql_service: mysql
when: is_debuntu
2017-05-27 18:09:50 +00:00
# PLATFORM variables
2017-05-27 18:09:50 +00:00
- name: Fedora 20
set_fact:
is_F20: True
when: ansible_distribution == "Fedora" and ansible_distribution_version == "20"
- name: Fedora 21
set_fact:
is_F21: True
when: ansible_distribution == "Fedora" and ansible_distribution_version == "21"
- name: Fedora 22
set_fact:
is_F22: True
when: ansible_distribution == "Fedora" and ansible_distribution_version == "22"
- name: Fedora 23
set_fact:
is_F23: True
when: ansible_distribution == "Fedora" and ansible_distribution_version == "23"
- name: Fedora 24
set_fact:
is_F24: True
when: ansible_distribution == "Fedora" and ansible_distribution_version == "24"
- name: CentOS
set_fact:
is_CentOS: True
when: ansible_distribution == "CentOS"