mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #674 from holta/0-init
indentation/syntax per new Ansible docs in 0-init; descriptions for all 9 stages
This commit is contained in:
commit
aa603d3100
15 changed files with 163 additions and 146 deletions
|
@ -1,9 +1,9 @@
|
|||
# use these as a tag a release at a point in time
|
||||
# Use these to tag a release at a point in time, for /etc/iiab/iiab.env
|
||||
iiab_base_ver: 6.5
|
||||
iiab_revision: 0
|
||||
|
||||
# These entries should never be changed in this file.
|
||||
# These are defaults for boolean routines,
|
||||
# These are defaults for boolean routines.
|
||||
first_run: False
|
||||
rpi_model: none
|
||||
is_rpi: False
|
||||
|
@ -21,10 +21,10 @@ is_F18: False
|
|||
rtc_id: ds3231
|
||||
NUC6_firmware_needed: False
|
||||
|
||||
# used in 2-common xo.yml
|
||||
# used in 2-common/tasks/xo.yml
|
||||
wifi_id: none
|
||||
|
||||
# used 3+ others
|
||||
# used in 2-common, 3-base-server and roles/network
|
||||
installing: False
|
||||
|
||||
# network
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
- name: Create various library directories
|
||||
file: path={{ item }}
|
||||
owner=root
|
||||
group=root
|
||||
mode=0755
|
||||
state=directory
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
with_items:
|
||||
- /etc/iiab
|
||||
- "{{ yum_packages_dir }}"
|
||||
|
@ -26,4 +27,3 @@
|
|||
- "{{ doc_root }}/common/services"
|
||||
- /etc/sysconfig/olpc-scripts/
|
||||
- /etc/sysconfig/olpc-scripts/setup.d/installed/
|
||||
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
- name: Turn the crank for systemd
|
||||
- name: Turn the crank for systemd (debuntu)
|
||||
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
|
||||
when: is_debuntu
|
||||
|
||||
- name: Configure /etc/sysconfig/network
|
||||
template: src=roles/network/templates/network/sysconfig.network.j2
|
||||
dest=/etc/sysconfig/network
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
- name: Configure /etc/sysconfig/network (redhat)
|
||||
template:
|
||||
src: roles/network/templates/network/sysconfig.network.j2
|
||||
dest: /etc/sysconfig/network
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: is_redhat
|
||||
|
||||
- name: Configure short hostname in /etc/hosts
|
||||
lineinfile: dest=/etc/hosts
|
||||
regexp='^127\.0\.0\.1'
|
||||
line='127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}'
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: "^127\.0\.0\.1"
|
||||
line: "127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
#- name: Re-configuring httpd - not initial install
|
||||
# include_tasks: roles/httpd/tasks/main.yml
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
# workaround for fact that auto create does not work on ini_file
|
||||
- name: Create iiab config file
|
||||
file:
|
||||
dest: '{{ iiab_config_file }}'
|
||||
state: touch
|
||||
dest: "{{ iiab_config_file }}"
|
||||
state: touch
|
||||
|
||||
- name: Add location section to config file
|
||||
ini_file:
|
||||
dest: '{{ iiab_config_file }}'
|
||||
section: location
|
||||
option: '{{ item.option }}'
|
||||
value: '{{ item.value }}'
|
||||
dest: "{{ iiab_config_file }}"
|
||||
section: location
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: 'iiab_base'
|
||||
value: '{{ iiab_base }}'
|
||||
- option: 'iiab_dir'
|
||||
value: '{{ iiab_dir }}'
|
||||
- option: iiab_base
|
||||
value: "{{ iiab_base }}"
|
||||
- option: iiab_dir
|
||||
value: "{{ iiab_dir }}"
|
||||
|
||||
- name: add version section
|
||||
ini_file:
|
||||
dest: '{{ iiab_config_file }}'
|
||||
dest: "{{ iiab_config_file }}"
|
||||
section: version
|
||||
option: '{{ item.option }}'
|
||||
value: '{{ item.value }}'
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: 'distribution'
|
||||
value: '{{ ansible_distribution }}'
|
||||
- option: 'arch'
|
||||
value: '{{ ansible_architecture }}'
|
||||
- option: 'iiab_base_ver'
|
||||
value: '{{ iiab_base_ver }}'
|
||||
- option: 'iiab_branch'
|
||||
value: '{{ ansible_local.local_facts.iiab_branch }}'
|
||||
- option: 'iiab_commit'
|
||||
value: '{{ ansible_local.local_facts.iiab_commit }}'
|
||||
- option: 'install_date'
|
||||
value: '{{ ansible_date_time.iso8601 }}'
|
||||
- option: 'install_xo'
|
||||
value: '{{ xo_model }}'
|
||||
- option: distribution
|
||||
value: "{{ ansible_distribution }}"
|
||||
- option: arch
|
||||
value: "{{ ansible_architecture }}"
|
||||
- option: iiab_base_ver
|
||||
value: "{{ iiab_base_ver }}"
|
||||
- option: iiab_branch
|
||||
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
||||
- option: iiab_commit
|
||||
value: "{{ ansible_local.local_facts.iiab_commit }}"
|
||||
- option: install_date
|
||||
value: "{{ ansible_date_time.iso8601 }}"
|
||||
- option: install_xo
|
||||
value: "{{ xo_model }}"
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
gui_port: 443
|
||||
when: adm_cons_force_ssl
|
||||
|
||||
- name: Require MySQL to be on
|
||||
- name: Require MySQL to be on (mandatory in Stage 3!)
|
||||
set_fact:
|
||||
mysql_install: True
|
||||
mysql_enabled: True
|
||||
|
@ -168,42 +168,42 @@
|
|||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: 'iiab_stage'
|
||||
value: '{{ iiab_stage }}'
|
||||
- option: 'iiab_base_ver'
|
||||
value: '{{ iiab_base_ver }}'
|
||||
- option: 'iiab_revision'
|
||||
value: '{{ iiab_revision }}'
|
||||
- option: 'runtime_php'
|
||||
value: '{{ phplib_dir }}'
|
||||
- option: 'runtime_branch'
|
||||
value: '{{ ansible_local.local_facts.iiab_branch }}'
|
||||
- option: 'runtime_commit'
|
||||
value: '{{ ansible_local.local_facts.iiab_commit }}'
|
||||
- option: 'runtime_date'
|
||||
value: '{{ ansible_date_time.iso8601 }}'
|
||||
- option: 'ansible_version'
|
||||
value: '{{ ansible_local.local_facts.ansible_version }}'
|
||||
- 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 }}'
|
||||
- option: 'gw_active'
|
||||
value: '{{ gw_active }}'
|
||||
- option: 'internet_available'
|
||||
value: '{{ internet_available }}'
|
||||
- option: 'is_rpi'
|
||||
value: '{{ is_rpi }}'
|
||||
- option: 'first_run'
|
||||
value: '{{ first_run }}'
|
||||
- option: 'local_tz'
|
||||
value: '{{ local_tz }}'
|
||||
- option: 'FQDN_changed'
|
||||
value: '{{ FQDN_changed }}'
|
||||
- option: iiab_stage
|
||||
value: "{{ iiab_stage }}"
|
||||
- option: iiab_base_ver
|
||||
value: "{{ iiab_base_ver }}"
|
||||
- option: iiab_revision
|
||||
value: "{{ iiab_revision }}"
|
||||
- option: runtime_php
|
||||
value: "{{ phplib_dir }}"
|
||||
- option: runtime_branch
|
||||
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
||||
- option: runtime_commit
|
||||
value: "{{ ansible_local.local_facts.iiab_commit }}"
|
||||
- option: runtime_date
|
||||
value: "{{ ansible_date_time.iso8601 }}"
|
||||
- option: ansible_version
|
||||
value: "{{ ansible_local.local_facts.ansible_version }}"
|
||||
- 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 }}"
|
||||
- option: gw_active
|
||||
value: "{{ gw_active }}"
|
||||
- option: internet_available
|
||||
value: "{{ internet_available }}"
|
||||
- option: is_rpi
|
||||
value: "{{ is_rpi }}"
|
||||
- option: first_run
|
||||
value: "{{ first_run }}"
|
||||
- option: local_tz
|
||||
value: "{{ local_tz }}"
|
||||
- option: FQDN_changed
|
||||
value: "{{ FQDN_changed }}"
|
||||
|
||||
- name: Now changing FQDN
|
||||
include_tasks: hostname.yml
|
||||
|
@ -216,6 +216,6 @@
|
|||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: 'is_VM'
|
||||
value: 'yes'
|
||||
- option: is_VM
|
||||
value: "yes"
|
||||
when: is_VM is defined
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
|
||||
- name: Set local and iiab TZ to UTC if /etc/localtime is not set
|
||||
set_fact:
|
||||
local_tz: 'UTC'
|
||||
iiab_TZ: 'UTC'
|
||||
local_tz: "UTC"
|
||||
iiab_TZ: "UTC"
|
||||
when: TZ_set.stdout == ""
|
||||
|
||||
- name: Override ansible on timezone if TZ set
|
||||
set_fact:
|
||||
local_tz: '{{ TZ_set.stdout }}'
|
||||
local_tz: "{{ TZ_set.stdout }}"
|
||||
when: TZ_set.stdout != ""
|
||||
|
||||
- name: Using iiab TZ for local TZ
|
||||
set_fact:
|
||||
local_tz: '{{ iiab_TZ }}'
|
||||
local_tz: "{{ iiab_TZ }}"
|
||||
when: iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout"
|
||||
|
||||
- name: Set default Timezone from iiab TZ (debuntu)
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
===========
|
||||
Prep README
|
||||
===========
|
||||
=============
|
||||
1-prep README
|
||||
=============
|
||||
|
||||
This role is primarily hardware-focused, prior to OS additions/mods. Traditionally it included
|
||||
preliminaries like hostname and things specific to a particular platform, such as the XO laptop,
|
||||
done before the bulk of the install.
|
||||
This 1st stage is primarily hardware-focused, prior to OS additions/mods.
|
||||
|
||||
Traditionally it included preliminaries like hostname and things specific to a
|
||||
particular platform, such as the XO laptop, done before the bulk of the install.
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
=============
|
||||
Common README
|
||||
=============
|
||||
===============
|
||||
2-common README
|
||||
===============
|
||||
|
||||
This role aggregates roles containing packages and a few other tasks that are common to all platforms
|
||||
and are required before creating a functioning server.
|
||||
This 2nd stage is for OS-level roles/packages/tasks *common* to all platforms,
|
||||
prerequisites to building up a functioning server.
|
||||
|
||||
As in the case of 3-base-server, 4-server-options and 5-xo-services: this stage installs core server infra, that is not user-facing.
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
==================
|
||||
Base Server README
|
||||
==================
|
||||
====================
|
||||
3-base-server README
|
||||
====================
|
||||
|
||||
This role is a place to aggregate roles that are required to create a basic web server.
|
||||
The functionality here is not packages that are not directly consumed by users, which are in common,
|
||||
nor specific applications, such as those found in the apps and tools roles.
|
||||
This 3rd stage installs base server infra that Internet-in-a-Box requires, including:
|
||||
|
||||
The difference between this aggregate (3-base-server) and 4-server-options is that the roles here are required.
|
||||
- the web server (Apache for now, possibly NGINX in future)
|
||||
- administrator security (username iiab-admin by default)
|
||||
- MySQL (the database underlying many/most user-facing apps)
|
||||
|
||||
Eventually a graphical configuration console will be added here.
|
||||
4-server-options follows with more diverse/optional server infra functionality.
|
||||
|
||||
As in the case of 2-common, 4-server-options and 5-xo-services: this stage installs core server infra, that is not user-facing.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
=====================
|
||||
Server Options README
|
||||
=====================
|
||||
=======================
|
||||
4-server-options README
|
||||
=======================
|
||||
|
||||
This role is a place to aggregate roles that may be optionally added to the basic server,
|
||||
whereas the roles in base-server are required. As in the case of the base-server the
|
||||
functionality here is not packages that are not directly consumed by users, which are in common,
|
||||
nor specific applications, such as those found in the apps and tools roles.
|
||||
Whereas the roles/tasks in 3-base-server are required, this 4th stage includes more optional roles/tasks for core server infra.
|
||||
|
||||
It includes some networking fundamentals, before they're configured later on.
|
||||
|
||||
As in the case of 2-common, 3-base-server and 5-xo-services: this stage installs core server infra, that is not user-facing.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
==================
|
||||
XO Services README
|
||||
==================
|
||||
====================
|
||||
5-xo-services README
|
||||
====================
|
||||
|
||||
This role is a place to aggregate roles that provide specific services for One Laptop Per Child's XO laptops.
|
||||
This 5th stage provides services for One Laptop Per Child's XO laptops.
|
||||
|
||||
As in the case of 2-common, 3-base-server and 4-server-options: this stage installs core server infra, that is not user-facing.
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
===================
|
||||
Generic Apps README
|
||||
===================
|
||||
=====================
|
||||
6-generic-apps README
|
||||
=====================
|
||||
|
||||
This role is a place to aggregate roles that install apps of a more generic or collaborative nature,
|
||||
as opposed to educational or managment. Content Management Systems or Chat or Wiki applications
|
||||
would go here.
|
||||
This 6th stage is for apps of a more generic or collaborative nature, as opposed to educational or managerial apps in later stages.
|
||||
|
||||
Chat, Wiki and CMS's (Content Management Systems) can go here.
|
||||
|
||||
As in the case of 7-edu-apps, 8-mgmt-tools and 9-local-addons: this stage installs user-facing server apps.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
===================================
|
||||
Educational Apps and Content README
|
||||
===================================
|
||||
=================
|
||||
7-edu-apps README
|
||||
=================
|
||||
|
||||
This role is a place to aggregate roles that provide Educational Content or
|
||||
are specifically targetted at pedagogical activities.
|
||||
This 7th stage is for Educational Apps and Learning Content, including LMS's (Learning Management Systems).
|
||||
|
||||
As in the case of 6-generic-apps, 8-mgmt-tools and 9-local-addons: this stage installs user-facing server apps.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
======================================
|
||||
Assessment and Monitoring Tools README
|
||||
======================================
|
||||
===================
|
||||
8-mgmt-tools README
|
||||
===================
|
||||
|
||||
This role is a place to aggregate roles that provide tools for Administering and
|
||||
Monitoring the Server and for Assessing its use and effectiveness.
|
||||
This 8th stage provides managerial tools to Administer and Monitor the server -- and for Assessing its use and effectiveness.
|
||||
|
||||
As in the case of 6-generic-apps, 7-edu-apps and 9-local-addons: this stage installs user-facing server apps.
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
===================
|
||||
Local Addons README
|
||||
===================
|
||||
=====================
|
||||
9-local-addons README
|
||||
=====================
|
||||
|
||||
This role is a place to aggregate roles developed by various contributors or locally developed.
|
||||
This 9th stage is a placeholder for roles/tasks/server apps that are locally developed -- or of an experimental nature.
|
||||
|
||||
As in the case of 6-generic-apps, 7-edu-apps, and 8-mgmt-tools: this stage is intended to install user-facing server apps.
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
Create the role you wish to add to Internet-in-a-Box by following the pattern of another role or any other means.
|
||||
Consider creating your own Ansible role to add essential functionality to Internet-in-a-Box. You can copy any role you find within /opt/iiab/iiab/roles, and building from there!
|
||||
|
||||
Packaging
|
||||
---------
|
||||
|
||||
Add your role into the main.yml file in the tasks directory of the 9-local-addons role. It will now get installed as part of
|
||||
the next ansible run.
|
||||
Add your role into the main.yml file in the tasks directory of the 9-local-addons role.
|
||||
|
||||
It will then get installed as part of the next Ansible run (e.g. "cd /opt/iiab/iiab" and then "./iiab-install --reinstall").
|
||||
|
||||
More Info
|
||||
---------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue