mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
commit
797d3012c8
8 changed files with 47 additions and 41 deletions
30
iiab-install
30
iiab-install
|
@ -3,15 +3,6 @@
|
|||
# Add cmdline options for passing to ansible
|
||||
# Todo add proper shift to gobble up --debug --reinstall
|
||||
|
||||
if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then
|
||||
echo "Use './iiab-install' for regular installs, or to continue an install."
|
||||
echo "Use './iiab-install --reinstall' to force running all Stages 0-9."
|
||||
echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
||||
echo "Use './runtags' to run a single Stage or Tag or Role."
|
||||
echo "Use './iiab-network' to run Network sections."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PLAYBOOK="iiab-stages.yml"
|
||||
INVENTORY="ansible_hosts"
|
||||
ARGS=""
|
||||
|
@ -23,12 +14,27 @@ MIN_ANSIBLE_VER=2.4.1.0
|
|||
|
||||
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
|
||||
|
||||
if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then
|
||||
mkdir -p /etc/ansible/facts.d
|
||||
fi
|
||||
cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact
|
||||
echo "Placed /etc/ansible/facts.d/local_facts.fact into position."
|
||||
|
||||
if [ ! -f $PLAYBOOK ]; then
|
||||
echo "EXITING: IIAB Playbook not found."
|
||||
echo "Please run 'iiab-install' from /opt/iiab/iiab (top level of git repo)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then
|
||||
echo "Use './iiab-install' for regular installs, or to continue an install."
|
||||
echo "Use './iiab-install --reinstall' to force running all Stages 0-9."
|
||||
echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
||||
echo "Use './runtags' to run a single Stage or Tag or Role."
|
||||
echo "Use './iiab-network' to run Network sections."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Subroutine compares software version numbers. Generates rare false positives
|
||||
# like "1.0 > 1" and "2.4.0 > 2.4". Avoid risks by structuring conditionals w/
|
||||
# a consistent # of decimal points e.g. "if version_gt w.x.y.z a.b.c.d; then"
|
||||
|
@ -61,12 +67,6 @@ if version_gt $MIN_ANSIBLE_VER $CURR_ANSIBLE_VER; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then
|
||||
mkdir -p /etc/ansible/facts.d
|
||||
fi
|
||||
cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact
|
||||
echo "Placed /etc/ansible/facts.d/local_facts.fact into position."
|
||||
|
||||
# Stage 0 will always be run. From there on up to Stage 9 we keep a counter
|
||||
# (in /etc/iiab/iiab.env) of the highest completed Stage. Avoid repetition!
|
||||
STAGE=0
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
group=root
|
||||
mode=0644
|
||||
|
||||
- name: Re-configuring httpd - not initial install
|
||||
include_tasks: roles/httpd/tasks/main.yml
|
||||
when: iiab_stage|int > 3
|
||||
#- name: Re-configuring httpd - not initial install
|
||||
# include_tasks: roles/httpd/tasks/main.yml
|
||||
# when: iiab_stage|int > 3
|
||||
|
||||
- name: Re-configuring rest of networking - not initial install
|
||||
include_tasks: roles/network/tasks/main.yml
|
||||
when: iiab_stage|int > 4
|
||||
#- name: Re-configuring rest of networking - not initial install
|
||||
# include_tasks: roles/network/tasks/main.yml
|
||||
# when: iiab_stage|int > 4
|
|
@ -199,7 +199,7 @@
|
|||
value: '{{ FQDN_changed }}'
|
||||
|
||||
- name: Now changing FQDN
|
||||
include_tasks: roles/2-common/tasks/hostname.yml
|
||||
include_tasks: hostname.yml
|
||||
when: FQDN_changed
|
||||
|
||||
- name: STAGE 0 HAS COMPLETED ======================================
|
||||
|
|
|
@ -6,19 +6,19 @@
|
|||
user_wan_iface: "{{ discovered_wan_iface }}"
|
||||
when: discovered_wan_iface != "none" and xo_model != "none" and has_ifcfg_gw == "none"
|
||||
|
||||
- name: Checking for NetworkManager-config-server
|
||||
shell: rpm -qa | grep NetworkManager-config-server | wc -l
|
||||
register: strict_networking_check
|
||||
#- name: Checking for NetworkManager-config-server
|
||||
# shell: rpm -qa | grep NetworkManager-config-server | wc -l
|
||||
# register: strict_networking_check
|
||||
|
||||
- name: Found Checking for NetworkManager-config-server
|
||||
set_fact:
|
||||
strict_networking: True
|
||||
when: strict_networking_check == "1"
|
||||
#- name: Found Checking for NetworkManager-config-server
|
||||
# set_fact:
|
||||
# strict_networking: True
|
||||
# when: strict_networking_check == "1"
|
||||
|
||||
- name: Use restricted network features
|
||||
set_fact:
|
||||
iiab_demo_mode: True
|
||||
when: teamviewer_install and not strict_networking
|
||||
#- name: Use restricted network features
|
||||
# set_fact:
|
||||
# iiab_demo_mode: True
|
||||
# when: teamviewer_install and not strict_networking
|
||||
|
||||
- name: XO laptop wants USB WiFi interface as AP mode
|
||||
set_fact:
|
||||
|
|
|
@ -17,7 +17,13 @@
|
|||
createhome=no
|
||||
when: is_debuntu
|
||||
|
||||
- name: Configure dhcpd
|
||||
- name: Disable stock dhcp_service
|
||||
service: name={{ dhcp_service }}
|
||||
enabled=no
|
||||
state=stopped
|
||||
when: is_debuntu
|
||||
|
||||
- name: Install systemd unit file to /etc/systemd/system/dhcpd.service
|
||||
template: src={{ item.src }}
|
||||
dest={{ item.dest }}
|
||||
owner=root
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
- name: Disable stock dhcp_service
|
||||
service: name={{ dhcp_service }}
|
||||
enabled=no
|
||||
state=stopped
|
||||
when: dhcpd_install and first_run and is_debuntu
|
||||
|
||||
- name: Disable dhcpd service
|
||||
service: name=dhcpd
|
||||
enabled=no
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
- name: Stop Squid service
|
||||
service: name={{ proxy }}
|
||||
state=stopped
|
||||
async: 120
|
||||
when: squid_install
|
||||
|
||||
- name: Stop DansGuardian
|
||||
|
|
|
@ -5,7 +5,7 @@ VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2`
|
|||
VERSION_ID=${VERSION_ID//\"/}
|
||||
VERSION_ID=${VERSION_ID%%.*}
|
||||
OS_VER=$OS-$VERSION_ID
|
||||
DHCPCD=`which dhcpcd`
|
||||
DHCPCD_PATH=`which dhcpcd`
|
||||
|
||||
case $OS_VER in
|
||||
"fedora-18" | \
|
||||
|
@ -53,6 +53,11 @@ else
|
|||
STAGE=0
|
||||
fi
|
||||
ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ")
|
||||
|
||||
if [ ! x$DHCPCD_PATH = x ]
|
||||
then
|
||||
DHCPCD=`systemctl is-enabled dhcpcd`
|
||||
fi
|
||||
cat <<EOF
|
||||
{"phplib_dir" : "$PHPLIB_DIR",
|
||||
"stage" : "$STAGE",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue