Split deploy scripts and make them publicly available
Change-Id: I5bdb93598a7e861dab2b048dce61e440df53b4e0
This commit is contained in:
parent
faf4b6b61b
commit
366d5a8497
|
@ -10,7 +10,7 @@
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
doc/build/
|
doc/build/
|
||||||
scripts/.vagrant/
|
doc/source/_static/scripts/.vagrant/
|
||||||
|
|
||||||
# Packages #
|
# Packages #
|
||||||
############
|
############
|
||||||
|
|
48
scripts/bootstrap-salt-master-git.sh → doc/source/_static/scripts/bootstrap/salt-formula-git.sh
Executable file → Normal file
48
scripts/bootstrap-salt-master-git.sh → doc/source/_static/scripts/bootstrap/salt-formula-git.sh
Executable file → Normal file
|
@ -8,54 +8,6 @@ RECLASS_BRANCH=${RECLASS_BRANCH:-master}
|
||||||
|
|
||||||
declare -a FORMULA_SERVICES=("linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx")
|
declare -a FORMULA_SERVICES=("linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx")
|
||||||
|
|
||||||
|
|
||||||
printf "\nPreparing base OS repository ...\n"
|
|
||||||
which wget > /dev/null || (apt-get update; apt-get install -y wget)
|
|
||||||
|
|
||||||
printf "deb [arch=amd64] http://apt.tcpcloud.eu/nightly/ trusty main security extra tcp tcp-salt" > /etc/apt/sources.list
|
|
||||||
wget -O - http://apt.tcpcloud.eu/public.gpg | apt-key add -
|
|
||||||
|
|
||||||
apt-get clean
|
|
||||||
apt-get update
|
|
||||||
|
|
||||||
printf "\nInstalling salt master ...\n"
|
|
||||||
apt-get install git salt-master python-reclass -y
|
|
||||||
|
|
||||||
printf "\nConfiguring salt minion ...\n"
|
|
||||||
[ ! -d /etc/salt/minion.d ] && mkdir -p /etc/salt/minion.d
|
|
||||||
printf "id: ${CONFIG_HOST}\n" > /etc/salt/minion.d/minion.conf
|
|
||||||
printf "master: localhost" >> /etc/salt/minion.d/minion.conf
|
|
||||||
|
|
||||||
printf "\nConfiguring salt master ...\n"
|
|
||||||
cat << 'EOF' > /etc/salt/master.d/master.conf
|
|
||||||
file_roots:
|
|
||||||
base:
|
|
||||||
- /usr/share/salt-formulas/env
|
|
||||||
dev:
|
|
||||||
- /srv/salt/env/dev
|
|
||||||
pillar_opts: False
|
|
||||||
reclass: &reclass
|
|
||||||
storage_type: yaml_fs
|
|
||||||
inventory_base_uri: /srv/salt/reclass
|
|
||||||
ext_pillar:
|
|
||||||
- reclass: *reclass
|
|
||||||
master_tops:
|
|
||||||
reclass: *reclass
|
|
||||||
EOF
|
|
||||||
|
|
||||||
printf "\nConfiguring reclass ...\n"
|
|
||||||
mkdir -p /etc/reclass
|
|
||||||
cat << 'EOF' > /etc/reclass/reclass-config.yml
|
|
||||||
storage_type: yaml_fs
|
|
||||||
pretty_print: True
|
|
||||||
output: yaml
|
|
||||||
inventory_base_uri: /srv/salt/reclass
|
|
||||||
EOF
|
|
||||||
|
|
||||||
git clone ${RECLASS_ADDRESS} /srv/salt/reclass -b ${RECLASS_BRANCH}
|
|
||||||
mkdir -p /srv/salt/reclass/classes/service
|
|
||||||
mkdir -p /usr/share/salt-formulas/reclass/service
|
|
||||||
|
|
||||||
[ ! -d /srv/salt/env ] && mkdir -p /srv/salt/env
|
[ ! -d /srv/salt/env ] && mkdir -p /srv/salt/env
|
||||||
[ ! -e "/srv/salt/env/dev" ] && ln -s /usr/share/salt-formulas/env /srv/salt/env/dev
|
[ ! -e "/srv/salt/env/dev" ] && ln -s /usr/share/salt-formulas/env /srv/salt/env/dev
|
||||||
|
|
1
scripts/bootstrap-salt-master-pkg.sh → doc/source/_static/scripts/bootstrap/salt-formula-pkg.sh
Executable file → Normal file
1
scripts/bootstrap-salt-master-pkg.sh → doc/source/_static/scripts/bootstrap/salt-formula-pkg.sh
Executable file → Normal file
|
@ -14,7 +14,6 @@ apt-get clean
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
||||||
echo "Configuring salt master ..."
|
echo "Configuring salt master ..."
|
||||||
apt-get install -y salt-master
|
|
||||||
apt-get install -y salt-formula-linux salt-formula-reclass salt-formula-salt
|
apt-get install -y salt-formula-linux salt-formula-reclass salt-formula-salt
|
||||||
apt-get install -y salt-formula-openssh salt-formula-ntp salt-formula-git
|
apt-get install -y salt-formula-openssh salt-formula-ntp salt-formula-git
|
||||||
apt-get install -y salt-formula-collectd salt-formula-sensu salt-formula-heka
|
apt-get install -y salt-formula-collectd salt-formula-sensu salt-formula-heka
|
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/bash -x
|
||||||
|
|
||||||
|
printf "\nPreparing base OS repository ...\n"
|
||||||
|
which wget > /dev/null || (apt-get update; apt-get install -y wget)
|
||||||
|
|
||||||
|
printf "deb [arch=amd64] http://apt.tcpcloud.eu/nightly/ trusty main security extra tcp tcp-salt" > /etc/apt/sources.list
|
||||||
|
wget -O - http://apt.tcpcloud.eu/public.gpg | apt-key add -
|
||||||
|
|
||||||
|
apt-get clean
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
printf "\nInstalling salt master ...\n"
|
||||||
|
apt-get install git salt-master python-reclass -y
|
||||||
|
|
||||||
|
cat << 'EOF' > /etc/salt/master.d/master.conf
|
||||||
|
file_roots:
|
||||||
|
base:
|
||||||
|
- /usr/share/salt-formulas/env
|
||||||
|
pillar_opts: False
|
||||||
|
open_mode: True
|
||||||
|
reclass: &reclass
|
||||||
|
storage_type: yaml_fs
|
||||||
|
inventory_base_uri: /srv/salt/reclass
|
||||||
|
ext_pillar:
|
||||||
|
- reclass: *reclass
|
||||||
|
master_tops:
|
||||||
|
reclass: *reclass
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "Configuring reclass ..."
|
||||||
|
git clone $RECLASS_ADDRESS /srv/salt/reclass -b master
|
||||||
|
mkdir -p /srv/salt/reclass/classes/service
|
||||||
|
|
||||||
|
for i in /usr/share/salt-formulas/reclass/service/*; do
|
||||||
|
ln -s $i /srv/salt/reclass/classes/service/
|
||||||
|
done
|
||||||
|
|
||||||
|
[ ! -d /etc/reclass ] && mkdir /etc/reclass
|
||||||
|
cat << 'EOF' > /etc/reclass/reclass-config.yml
|
||||||
|
storage_type: yaml_fs
|
||||||
|
pretty_print: True
|
||||||
|
output: yaml
|
||||||
|
inventory_base_uri: /srv/salt/reclass
|
||||||
|
EOF
|
||||||
|
|
||||||
|
git clone ${RECLASS_ADDRESS} /srv/salt/reclass -b ${RECLASS_BRANCH}
|
||||||
|
mkdir -p /srv/salt/reclass/classes/service
|
||||||
|
mkdir -p /usr/share/salt-formulas/reclass/service
|
|
@ -72,17 +72,17 @@ Prepare basic configuration files for each node deployed.
|
||||||
|
|
||||||
Set ``/srv/vagrant-openstack/minions/config.conf`` to following:
|
Set ``/srv/vagrant-openstack/minions/config.conf`` to following:
|
||||||
|
|
||||||
.. literalinclude:: ../../../scripts/minions/config.conf
|
.. literalinclude:: /_static/scripts/minions/config.conf
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
Set ``/srv/vagrant-openstack/minions/control.conf`` to following:
|
Set ``/srv/vagrant-openstack/minions/control.conf`` to following:
|
||||||
|
|
||||||
.. literalinclude:: ../../../scripts/minions/control.conf
|
.. literalinclude:: /_static/scripts/minions/control.conf
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
Set ``/srv/vagrant-openstack/minions/compute.conf`` to following content:
|
Set ``/srv/vagrant-openstack/minions/compute.conf`` to following content:
|
||||||
|
|
||||||
.. literalinclude:: ../../../scripts/minions/compute.conf
|
.. literalinclude:: /_static/scripts/minions/compute.conf
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ Vagrant configuration file
|
||||||
|
|
||||||
The main vagrant configuration for OpenStack-Salt deployment is located at ``/srv/vagrant-openstack/Vagrantfile``.
|
The main vagrant configuration for OpenStack-Salt deployment is located at ``/srv/vagrant-openstack/Vagrantfile``.
|
||||||
|
|
||||||
.. literalinclude:: ../../../scripts/Vagrantfile
|
.. literalinclude:: /_static/scripts/Vagrantfile
|
||||||
:language: ruby
|
:language: ruby
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ Salt master bootstrap file
|
||||||
|
|
||||||
The salt-master bootstrap is located at ``/srv/vagrant-openstack/bootstrap-salt-master.sh`` and it needs to be placed at the vagrant-openstack folder to be accessible from the virtual machine.
|
The salt-master bootstrap is located at ``/srv/vagrant-openstack/bootstrap-salt-master.sh`` and it needs to be placed at the vagrant-openstack folder to be accessible from the virtual machine.
|
||||||
|
|
||||||
.. literalinclude:: ../../../scripts/bootstrap-salt-master-pkg.sh
|
.. literalinclude:: /_static/scripts/bootstrap/salt-master-pkg.sh
|
||||||
:language: bash
|
:language: bash
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f5383a44be710022e88fc14df049b58b250f3773
|
Subproject commit 0aaf5affa08286a51d5fd63bbc7881abfcf7d1a5
|
|
@ -1 +1 @@
|
||||||
Subproject commit a6d4a78bc9553096c6ab2531e7f390b2b046003b
|
Subproject commit f0734889b83d3da19508bc33d62cc17271aaeaf5
|
|
@ -1 +1 @@
|
||||||
Subproject commit b4b8059b2173488004d20e21f19a4805ca057358
|
Subproject commit a440aeb32b9b8b0fa40cf97ff813a2c275161de6
|
Loading…
Reference in New Issue