Add templates to build TryMCP image
Author: Pavel Cizinsky, pcizinsky@mirantis.com
Change-Id: I35a667c667a1b68f178e5a7b4201400827a17235
diff --git a/trymcp-day01-image/files/etc/cloud/cloud.cfg b/trymcp-day01-image/files/etc/cloud/cloud.cfg
new file mode 100644
index 0000000..953ceb8
--- /dev/null
+++ b/trymcp-day01-image/files/etc/cloud/cloud.cfg
@@ -0,0 +1,98 @@
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the above $user (ubuntu)
+disable_root: false
+
+# This will cause the set+update hostname module to not operate (if true)
+preserve_hostname: false
+apt_preserve_sources_list: true
+
+# Better let managing of /etc/hosts on salt and others
+# manage_etc_hosts: localhost
+
+# The modules that run in the 'init' stage
+cloud_init_modules:
+ - migrator
+ - seed_random
+ - bootcmd
+ - write-files
+ - growpart
+ - resizefs
+ - set_hostname
+ - update_hostname
+ - update_etc_hosts
+ - ca-certs
+ - rsyslog
+ - users-groups
+ - ssh
+
+# The modules that run in the 'config' stage
+cloud_config_modules:
+# Emit the cloud config ready event
+# this can be used by upstart jobs for 'start on cloud-config'.
+ - emit_upstart
+ - disk_setup
+ - mounts
+ - ssh-import-id
+ - locale
+ - set-passwords
+ - grub-dpkg
+ - apt-pipelining
+ - apt-configure
+ - package-update-upgrade-install
+ - landscape
+ - timezone
+ - puppet
+ - chef
+ - salt-minion
+ - mcollective
+ - disable-ec2-metadata
+ - runcmd
+ - byobu
+
+# The modules that run in the 'final' stage
+cloud_final_modules:
+ - rightscale_userdata
+ - scripts-vendor
+ - scripts-per-once
+ - scripts-per-boot
+ - scripts-per-instance
+ - scripts-user
+ - ssh-authkey-fingerprints
+ - keys-to-console
+ - phone-home
+ - final-message
+ - power-state-change
+
+datasource_list: [ NoCloud, ConfigDrive, Ec2, OpenStack, OVF, MAAS, None ]
+datasource:
+ Ec2:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+ OpenStack:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+ MAAS:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+
+hostname: cfg01.try-mcp.local
+runcmd:
+ - sed -i'.orig' -e's/PermitRootLogin.*/PermitRootLogin yes/g' -e's/PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
+ - service sshd restart
+ - salt-call --timeout=120 test.ping
+ - salt-call saltutil.sync_all
+ - systemctl restart docker
+ - sleep 20
+ - salt-call state.sls docker.swarm
+ - sleep 60
+ - salt-call state.sls nginx
+ - sleep 25
+ - salt-call state.sls keycloak
+ - sleep 20
+ - salt-call state.sls docker.client
+ - sleep 60
+ - salt-call state.sls openldap
+ - sleep 20
+ - salt-call state.sls gerrit
+ - sleep 25
+ - salt-call state.sls jenkins
diff --git a/trymcp-day01-image/files/etc/cloud/cloud.cfg.d/99_tcp.cfg b/trymcp-day01-image/files/etc/cloud/cloud.cfg.d/99_tcp.cfg
new file mode 120000
index 0000000..a375da9
--- /dev/null
+++ b/trymcp-day01-image/files/etc/cloud/cloud.cfg.d/99_tcp.cfg
@@ -0,0 +1 @@
+../../../../../day01-image/files/etc/cloud/cloud.cfg.d/99_tcp.cfg
\ No newline at end of file
diff --git a/trymcp-day01-image/files/etc/rc.local b/trymcp-day01-image/files/etc/rc.local
new file mode 100644
index 0000000..6b31cac
--- /dev/null
+++ b/trymcp-day01-image/files/etc/rc.local
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+
+if [ ! -f /tmp/bootstrap_interfaces ] && [ -d /srv/salt/reclass/nodes/_generated ]; then
+ sed -i "s/single_address:.*/single_address: $(hostname -I | cut -d ' ' -f 1)/g" /srv/salt/reclass/nodes/cfg01.*
+ touch /tmp/bootstrap_interfaces
+fi
+
+exit 0
diff --git a/trymcp-day01-image/files/etc/screenrc b/trymcp-day01-image/files/etc/screenrc
new file mode 120000
index 0000000..c575744
--- /dev/null
+++ b/trymcp-day01-image/files/etc/screenrc
@@ -0,0 +1 @@
+../../../day01-image/files/etc/screenrc
\ No newline at end of file
diff --git a/trymcp-day01-image/files/etc/tmux.conf b/trymcp-day01-image/files/etc/tmux.conf
new file mode 120000
index 0000000..f218b11
--- /dev/null
+++ b/trymcp-day01-image/files/etc/tmux.conf
@@ -0,0 +1 @@
+../../../day01-image/files/etc/tmux.conf
\ No newline at end of file