1
0
Fork 0
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:
A Holt 2018-02-12 20:43:07 -05:00 committed by GitHub
commit aa603d3100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 163 additions and 146 deletions

View file

@ -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_base_ver: 6.5
iiab_revision: 0 iiab_revision: 0
# These entries should never be changed in this file. # These entries should never be changed in this file.
# These are defaults for boolean routines, # These are defaults for boolean routines.
first_run: False first_run: False
rpi_model: none rpi_model: none
is_rpi: False is_rpi: False
@ -21,10 +21,10 @@ is_F18: False
rtc_id: ds3231 rtc_id: ds3231
NUC6_firmware_needed: False NUC6_firmware_needed: False
# used in 2-common xo.yml # used in 2-common/tasks/xo.yml
wifi_id: none wifi_id: none
# used 3+ others # used in 2-common, 3-base-server and roles/network
installing: False installing: False
# network # network

View file

@ -1,9 +1,10 @@
- name: Create various library directories - name: Create various library directories
file: path={{ item }} file:
owner=root path: "{{ item }}"
group=root owner: root
mode=0755 group: root
state=directory mode: 0755
state: directory
with_items: with_items:
- /etc/iiab - /etc/iiab
- "{{ yum_packages_dir }}" - "{{ yum_packages_dir }}"
@ -26,4 +27,3 @@
- "{{ doc_root }}/common/services" - "{{ doc_root }}/common/services"
- /etc/sysconfig/olpc-scripts/ - /etc/sysconfig/olpc-scripts/
- /etc/sysconfig/olpc-scripts/setup.d/installed/ - /etc/sysconfig/olpc-scripts/setup.d/installed/

View file

@ -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 }}" shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
when: is_debuntu when: is_debuntu
- name: Configure /etc/sysconfig/network - name: Configure /etc/sysconfig/network (redhat)
template: src=roles/network/templates/network/sysconfig.network.j2 template:
dest=/etc/sysconfig/network src: roles/network/templates/network/sysconfig.network.j2
owner=root dest: /etc/sysconfig/network
group=root owner: root
mode=0644 group: root
mode: 0644
when: is_redhat when: is_redhat
- name: Configure short hostname in /etc/hosts - name: Configure short hostname in /etc/hosts
lineinfile: dest=/etc/hosts lineinfile:
regexp='^127\.0\.0\.1' dest: /etc/hosts
line='127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}' regexp: "^127\.0\.0\.1"
owner=root line: "127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}"
group=root owner: root
mode=0644 group: root
mode: 0644
#- name: Re-configuring httpd - not initial install #- name: Re-configuring httpd - not initial install
# include_tasks: roles/httpd/tasks/main.yml # include_tasks: roles/httpd/tasks/main.yml

View file

@ -1,39 +1,39 @@
# workaround for fact that auto create does not work on ini_file # workaround for fact that auto create does not work on ini_file
- name: Create iiab config file - name: Create iiab config file
file: file:
dest: '{{ iiab_config_file }}' dest: "{{ iiab_config_file }}"
state: touch state: touch
- name: Add location section to config file - name: Add location section to config file
ini_file: ini_file:
dest: '{{ iiab_config_file }}' dest: "{{ iiab_config_file }}"
section: location section: location
option: '{{ item.option }}' option: "{{ item.option }}"
value: '{{ item.value }}' value: "{{ item.value }}"
with_items: with_items:
- option: 'iiab_base' - option: iiab_base
value: '{{ iiab_base }}' value: "{{ iiab_base }}"
- option: 'iiab_dir' - option: iiab_dir
value: '{{ iiab_dir }}' value: "{{ iiab_dir }}"
- name: add version section - name: add version section
ini_file: ini_file:
dest: '{{ iiab_config_file }}' dest: "{{ iiab_config_file }}"
section: version section: version
option: '{{ item.option }}' option: "{{ item.option }}"
value: '{{ item.value }}' value: "{{ item.value }}"
with_items: with_items:
- option: 'distribution' - option: distribution
value: '{{ ansible_distribution }}' value: "{{ ansible_distribution }}"
- option: 'arch' - option: arch
value: '{{ ansible_architecture }}' value: "{{ ansible_architecture }}"
- option: 'iiab_base_ver' - option: iiab_base_ver
value: '{{ iiab_base_ver }}' value: "{{ iiab_base_ver }}"
- option: 'iiab_branch' - option: iiab_branch
value: '{{ ansible_local.local_facts.iiab_branch }}' value: "{{ ansible_local.local_facts.iiab_branch }}"
- option: 'iiab_commit' - option: iiab_commit
value: '{{ ansible_local.local_facts.iiab_commit }}' value: "{{ ansible_local.local_facts.iiab_commit }}"
- option: 'install_date' - option: install_date
value: '{{ ansible_date_time.iso8601 }}' value: "{{ ansible_date_time.iso8601 }}"
- option: 'install_xo' - option: install_xo
value: '{{ xo_model }}' value: "{{ xo_model }}"

View file

@ -93,7 +93,7 @@
gui_port: 443 gui_port: 443
when: adm_cons_force_ssl when: adm_cons_force_ssl
- name: Require MySQL to be on - name: Require MySQL to be on (mandatory in Stage 3!)
set_fact: set_fact:
mysql_install: True mysql_install: True
mysql_enabled: True mysql_enabled: True
@ -168,42 +168,42 @@
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"
with_items: with_items:
- option: 'iiab_stage' - option: iiab_stage
value: '{{ iiab_stage }}' value: "{{ iiab_stage }}"
- option: 'iiab_base_ver' - option: iiab_base_ver
value: '{{ iiab_base_ver }}' value: "{{ iiab_base_ver }}"
- option: 'iiab_revision' - option: iiab_revision
value: '{{ iiab_revision }}' value: "{{ iiab_revision }}"
- option: 'runtime_php' - option: runtime_php
value: '{{ phplib_dir }}' value: "{{ phplib_dir }}"
- option: 'runtime_branch' - option: runtime_branch
value: '{{ ansible_local.local_facts.iiab_branch }}' value: "{{ ansible_local.local_facts.iiab_branch }}"
- option: 'runtime_commit' - option: runtime_commit
value: '{{ ansible_local.local_facts.iiab_commit }}' value: "{{ ansible_local.local_facts.iiab_commit }}"
- option: 'runtime_date' - option: runtime_date
value: '{{ ansible_date_time.iso8601 }}' value: "{{ ansible_date_time.iso8601 }}"
- option: 'ansible_version' - option: ansible_version
value: '{{ ansible_local.local_facts.ansible_version }}' value: "{{ ansible_local.local_facts.ansible_version }}"
- option: 'kernel' - option: kernel
value: '{{ ansible_kernel }}' value: "{{ ansible_kernel }}"
- option: 'memory_mb' - option: memory_mb
value: '{{ ansible_memtotal_mb }}' value: "{{ ansible_memtotal_mb }}"
- option: 'swap_mb' - option: swap_mb
value: '{{ ansible_swaptotal_mb }}' value: "{{ ansible_swaptotal_mb }}"
- option: 'product_id' - option: product_id
value: '{{ ansible_product_uuid }}' value: "{{ ansible_product_uuid }}"
- option: 'gw_active' - option: gw_active
value: '{{ gw_active }}' value: "{{ gw_active }}"
- option: 'internet_available' - option: internet_available
value: '{{ internet_available }}' value: "{{ internet_available }}"
- option: 'is_rpi' - option: is_rpi
value: '{{ is_rpi }}' value: "{{ is_rpi }}"
- option: 'first_run' - option: first_run
value: '{{ first_run }}' value: "{{ first_run }}"
- option: 'local_tz' - option: local_tz
value: '{{ local_tz }}' value: "{{ local_tz }}"
- option: 'FQDN_changed' - option: FQDN_changed
value: '{{ FQDN_changed }}' value: "{{ FQDN_changed }}"
- name: Now changing FQDN - name: Now changing FQDN
include_tasks: hostname.yml include_tasks: hostname.yml
@ -216,6 +216,6 @@
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"
with_items: with_items:
- option: 'is_VM' - option: is_VM
value: 'yes' value: "yes"
when: is_VM is defined when: is_VM is defined

View file

@ -5,18 +5,18 @@
- name: Set local and iiab TZ to UTC if /etc/localtime is not set - name: Set local and iiab TZ to UTC if /etc/localtime is not set
set_fact: set_fact:
local_tz: 'UTC' local_tz: "UTC"
iiab_TZ: 'UTC' iiab_TZ: "UTC"
when: TZ_set.stdout == "" when: TZ_set.stdout == ""
- name: Override ansible on timezone if TZ set - name: Override ansible on timezone if TZ set
set_fact: set_fact:
local_tz: '{{ TZ_set.stdout }}' local_tz: "{{ TZ_set.stdout }}"
when: TZ_set.stdout != "" when: TZ_set.stdout != ""
- name: Using iiab TZ for local TZ - name: Using iiab TZ for local TZ
set_fact: set_fact:
local_tz: '{{ iiab_TZ }}' local_tz: "{{ iiab_TZ }}"
when: iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout" when: iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout"
- name: Set default Timezone from iiab TZ (debuntu) - name: Set default Timezone from iiab TZ (debuntu)

View file

@ -1,7 +1,8 @@
=========== =============
Prep README 1-prep README
=========== =============
This role is primarily hardware-focused, prior to OS additions/mods. Traditionally it included This 1st stage is primarily hardware-focused, prior to OS additions/mods.
preliminaries like hostname and things specific to a particular platform, such as the XO laptop,
done before the bulk of the install. 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.

View file

@ -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 This 2nd stage is for OS-level roles/packages/tasks *common* to all platforms,
and are required before creating a functioning server. 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.

View file

@ -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. This 3rd stage installs base server infra that Internet-in-a-Box requires, including:
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.
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.

View file

@ -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/tasks in 3-base-server are required, this 4th stage includes more optional roles/tasks for core server infra.
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, It includes some networking fundamentals, before they're configured later on.
nor specific applications, such as those found in the apps and tools roles.
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.

View file

@ -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.

View file

@ -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, This 6th stage is for apps of a more generic or collaborative nature, as opposed to educational or managerial apps in later stages.
as opposed to educational or managment. Content Management Systems or Chat or Wiki applications
would go here. 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.

View file

@ -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 This 7th stage is for Educational Apps and Learning Content, including LMS's (Learning Management Systems).
are specifically targetted at pedagogical activities.
As in the case of 6-generic-apps, 8-mgmt-tools and 9-local-addons: this stage installs user-facing server apps.

View file

@ -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 This 8th stage provides managerial tools to Administer and Monitor the server -- and for Assessing its use and effectiveness.
Monitoring 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.

View file

@ -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 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 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 Add your role into the main.yml file in the tasks directory of the 9-local-addons role.
the next ansible run.
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 More Info
--------- ---------