Add templates to build TryMCP image

Author: Pavel Cizinsky, pcizinsky@mirantis.com
Change-Id: I35a667c667a1b68f178e5a7b4201400827a17235
diff --git a/common/ubuntu_salt_bootstrap.sh b/common/ubuntu_salt_bootstrap.sh
index f03f757..cef2c3f 100644
--- a/common/ubuntu_salt_bootstrap.sh
+++ b/common/ubuntu_salt_bootstrap.sh
@@ -74,12 +74,12 @@
 export FORMULAS_SOURCE=pkg
 export HOSTNAME=${BS_HOSTNAME:-lost_bs_hostname_variable}
 export DOMAIN="${CLUSTER_NAME}.local"
-export EXTRA_FORMULAS=${EXTRA_FORMULAS:-"ntp aptly nginx iptables docker git maas jenkins logrotate"}
+export EXTRA_FORMULAS=${EXTRA_FORMULAS:-"aptly docker gerrit git iptables jenkins keycloak logrotate maas ntp nginx openldap sphinx"}
 export APT_REPOSITORY=" deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO} "
 export APT_REPOSITORY_GPG=${APT_MIRANTIS_GPG}
 export SALT_STOPSTART_WAIT=${SALT_STOPSTART_WAIT:-10}
 echo "INFO: build in offline build!"
-export BOOTSTRAP_SALTSTACK_COM="file:///tmp/bootstrap.saltstack.com.sh"
+export BOOTSTRAP_SALTSTACK_COM=${BOOTSTRAP_SALTSTACK_COM:-"file:///tmp/bootstrap.saltstack.com.sh"}
 # extra opts will push bootstrap script NOT install upstream repos.
 export BOOTSTRAP_SALTSTACK_OPTS=${BOOTSTRAP_SALTSTACK_OPTS:- -dXr $BOOTSTRAP_SALTSTACK_VERSION }
 #
diff --git a/trymcp-day01-image/config-drive/user-data.yaml b/trymcp-day01-image/config-drive/user-data.yaml
new file mode 100644
index 0000000..aa6ba9c
--- /dev/null
+++ b/trymcp-day01-image/config-drive/user-data.yaml
@@ -0,0 +1,16 @@
+#cloud-config
+debug: True
+ssh_pwauth: True
+disable_root: false
+chpasswd:
+  list: |
+    root:r00tme
+  expire: False
+output: {all: '| tee -a /var/log/cloud-init-output.log'}
+runcmd:
+  - sed -i'.orig' -e's/PermitRootLogin.*/PermitRootLogin yes/g' -e's/PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
+  - service sshd restart
+# speed up resolving, and not stuck on timeouts. One-shot changes
+  - echo 'options timeout:1 attempts:4' >> /etc/resolv.conf
+  - echo 'nameserver 172.18.208.44' >> /etc/resolvconf/resolv.conf.d/base
+  - resolvconf -u
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
diff --git a/trymcp-day01-image/files/opt/bootstrap.saltstack.com.sh b/trymcp-day01-image/files/opt/bootstrap.saltstack.com.sh
new file mode 120000
index 0000000..91edcdb
--- /dev/null
+++ b/trymcp-day01-image/files/opt/bootstrap.saltstack.com.sh
@@ -0,0 +1 @@
+../../../day01-image/files/tmp/bootstrap.saltstack.com.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/files/root/.vim/ident/jinja.vim b/trymcp-day01-image/files/root/.vim/ident/jinja.vim
new file mode 100644
index 0000000..25e8f66
--- /dev/null
+++ b/trymcp-day01-image/files/root/.vim/ident/jinja.vim
@@ -0,0 +1,80 @@
+" Vim indent file
+" Language:	Jinja HTML template
+" Maintainer:	Evan Hammer <evan@evanhammer.com>
+" Last Change:	2013 Jan 26
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
+
+" Use HTML formatting rules.
+setl indentkeys=o,O,<Return>,<>>,!^F
+runtime! indent/html.vim		 +setl nosmartindent
+let b:did_indent = 1
+
+" Indent within the jinja tags
+" Made by Steve Losh <steve@stevelosh.com>
+if &l:indentexpr == ''
+    if &l:cindent
+        let &l:indentexpr = 'cindent(v:lnum)'
+    else
+        let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
+    endif
+endif
+let b:html_indentexpr = &l:indentexpr
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetDjangoIndent()
+setlocal indentkeys=o,O,*<Return>,{,},o,O,!^F,<>>
+
+" Only define the function once.
+if exists("*GetDjangoIndent")
+    finish
+endif
+
+function! GetDjangoIndent(...)
+    if a:0 && a:1 == '.'
+        let v:lnum = line('.')
+    elseif a:0 && a:1 =~ '^\d'
+        let v:lnum = a:1
+    endif
+    let vcol = col('.')
+
+    call cursor(v:lnum,vcol)
+
+    exe "let ind = ".b:html_indentexpr
+
+    let lnum = prevnonblank(v:lnum-1)
+    let pnb = getline(lnum)
+    let cur = getline(v:lnum)
+
+    let tagstart = '.*' . '{%\s*'
+    let tagend = '.*%}' . '.*'
+
+    let blocktags = '\(block\|for\|if\|with\|autoescape\|comment\|filter\|spaceless\)'
+    let midtags = '\(empty\|else\|elif\)'
+
+    let pnb_blockstart = pnb =~# tagstart . blocktags . tagend
+    let pnb_blockend   = pnb =~# tagstart . 'end' . blocktags . tagend
+    let pnb_blockmid   = pnb =~# tagstart . midtags . tagend
+
+    let cur_blockstart = cur =~# tagstart . blocktags . tagend
+    let cur_blockend   = cur =~# tagstart . 'end' . blocktags . tagend
+    let cur_blockmid   = cur =~# tagstart . midtags . tagend
+
+    if pnb_blockstart && !pnb_blockend
+        let ind = ind + &sw
+    elseif pnb_blockmid && !pnb_blockend
+        let ind = ind + &sw
+    endif
+
+    if cur_blockend && !cur_blockstart
+        let ind = ind - &sw
+    elseif cur_blockmid
+        let ind = ind - &sw
+    endif
+
+    return ind
+endfunction
diff --git a/trymcp-day01-image/files/root/.vim/syntax/groovy.vim b/trymcp-day01-image/files/root/.vim/syntax/groovy.vim
new file mode 100644
index 0000000..5f96dfb
--- /dev/null
+++ b/trymcp-day01-image/files/root/.vim/syntax/groovy.vim
@@ -0,0 +1,450 @@
+" Vim syntax file
+" Language:	Groovy
+" Maintainer:	Alessio Pace <billy.corgan@tiscali.it>
+" Version: 	0.1.9b
+" URL:	  http://www.vim.org/scripts/script.php?script_id=945	
+" Last Change:	6/4/2004
+
+" This is my very first vim script, I hope to have
+" done it the right way.
+" 
+" I must directly or indirectly thank the author of java.vim and ruby.vim:
+" I copied from them most of the stuff :-)
+"
+" Relies on html.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+"
+" HOWTO USE IT (INSTALL):
+" [groovy is still not recognized by vim! :-( ]
+"
+" 1) copy the file in the (global or user's $HOME/.vim/syntax/) syntax folder
+" 
+" 2) add this line to recognize groovy files by filename extension:
+"
+" au BufNewFile,BufRead *.groovy  setf groovy
+" in the global vim filetype.vim file or inside $HOME/.vim/filetype.vim
+"
+" 3) add this part to recognize by content groovy script (no extension needed :-)
+"
+"  if did_filetype()
+"    finish
+"  endif
+"  if getline(1) =~ '^#!.*[/\\]groovy\>'
+"    setf groovy
+"  endif
+"
+"  in the global scripts.vim file or in $HOME/.vim/scripts.vim
+" 
+" 4) open/write a .groovy file or a groovy script :-)
+"
+" Let me know if you like it or send me patches, so that I can improve it
+" when I have time
+
+" Quit when a syntax file was already loaded
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+    finish
+  endif
+  " we define it here so that included files can test for it
+  let main_syntax='groovy'
+endif
+
+" don't use standard HiLink, it will not work with included syntax files
+if version < 508
+  command! -nargs=+ GroovyHiLink hi link <args>
+else
+  command! -nargs=+ GroovyHiLink hi def link <args>
+endif
+
+" ##########################
+" Java stuff taken from java.vim
+" some characters that cannot be in a groovy program (outside a string)
+" syn match groovyError "[\\@`]"
+"syn match groovyError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
+"syn match groovyOK "\.\.\."
+
+" keyword definitions
+syn keyword groovyExternal        native package
+syn match groovyExternal          "\<import\(\s\+static\>\)\?"
+syn keyword groovyError           goto const
+syn keyword groovyConditional     if else switch
+syn keyword groovyRepeat          while for do
+syn keyword groovyBoolean         true false
+syn keyword groovyConstant        null
+syn keyword groovyTypedef         this super
+syn keyword groovyOperator        new instanceof
+syn keyword groovyType            boolean char byte short int long float double
+syn keyword groovyType            void
+syn keyword groovyType		  Integer Double Date Boolean Float String Array Vector List
+syn keyword groovyStatement       return
+syn keyword groovyStorageClass    static synchronized transient volatile final strictfp serializable
+syn keyword groovyExceptions      throw try catch finally
+syn keyword groovyAssert          assert
+syn keyword groovyMethodDecl      synchronized throws
+syn keyword groovyClassDecl       extends implements interface
+" to differentiate the keyword class from MyClass.class we use a match here
+syn match   groovyTypedef         "\.\s*\<class\>"ms=s+1
+syn keyword groovyClassDecl         enum
+syn match   groovyClassDecl       "^class\>"
+syn match   groovyClassDecl       "[^.]\s*\<class\>"ms=s+1
+syn keyword groovyBranch          break continue nextgroup=groovyUserLabelRef skipwhite
+syn match   groovyUserLabelRef    "\k\+" contained
+syn keyword groovyScopeDecl       public protected private abstract
+
+
+if exists("groovy_highlight_groovy_lang_ids") || exists("groovy_highlight_groovy_lang") || exists("groovy_highlight_all")
+  " groovy.lang.*
+  syn keyword groovyLangClass  Closure MetaMethod GroovyObject
+  
+  syn match groovyJavaLangClass "\<System\>"
+  syn keyword groovyJavaLangClass  Cloneable Comparable Runnable Serializable Boolean Byte Class Object
+  syn keyword groovyJavaLangClass  Character CharSequence ClassLoader Compiler
+  " syn keyword groovyJavaLangClass  Integer Double Float Long 
+  syn keyword groovyJavaLangClass  InheritableThreadLocal Math Number Object Package Process
+  syn keyword groovyJavaLangClass  Runtime RuntimePermission InheritableThreadLocal
+  syn keyword groovyJavaLangClass  SecurityManager Short StrictMath StackTraceElement
+  syn keyword groovyJavaLangClass  StringBuffer Thread ThreadGroup
+  syn keyword groovyJavaLangClass  ThreadLocal Throwable Void ArithmeticException
+  syn keyword groovyJavaLangClass  ArrayIndexOutOfBoundsException AssertionError
+  syn keyword groovyJavaLangClass  ArrayStoreException ClassCastException
+  syn keyword groovyJavaLangClass  ClassNotFoundException
+  syn keyword groovyJavaLangClass  CloneNotSupportedException Exception
+  syn keyword groovyJavaLangClass  IllegalAccessException
+  syn keyword groovyJavaLangClass  IllegalArgumentException
+  syn keyword groovyJavaLangClass  IllegalMonitorStateException
+  syn keyword groovyJavaLangClass  IllegalStateException
+  syn keyword groovyJavaLangClass  IllegalThreadStateException
+  syn keyword groovyJavaLangClass  IndexOutOfBoundsException
+  syn keyword groovyJavaLangClass  InstantiationException InterruptedException
+  syn keyword groovyJavaLangClass  NegativeArraySizeException NoSuchFieldException
+  syn keyword groovyJavaLangClass  NoSuchMethodException NullPointerException
+  syn keyword groovyJavaLangClass  NumberFormatException RuntimeException
+  syn keyword groovyJavaLangClass  SecurityException StringIndexOutOfBoundsException
+  syn keyword groovyJavaLangClass  UnsupportedOperationException
+  syn keyword groovyJavaLangClass  AbstractMethodError ClassCircularityError
+  syn keyword groovyJavaLangClass  ClassFormatError Error ExceptionInInitializerError
+  syn keyword groovyJavaLangClass  IllegalAccessError InstantiationError
+  syn keyword groovyJavaLangClass  IncompatibleClassChangeError InternalError
+  syn keyword groovyJavaLangClass  LinkageError NoClassDefFoundError
+  syn keyword groovyJavaLangClass  NoSuchFieldError NoSuchMethodError
+  syn keyword groovyJavaLangClass  OutOfMemoryError StackOverflowError
+  syn keyword groovyJavaLangClass  ThreadDeath UnknownError UnsatisfiedLinkError
+  syn keyword groovyJavaLangClass  UnsupportedClassVersionError VerifyError
+  syn keyword groovyJavaLangClass  VirtualMachineError
+
+  syn keyword groovyJavaLangObject clone equals finalize getClass hashCode
+  syn keyword groovyJavaLangObject notify notifyAll toString wait
+
+  GroovyHiLink groovyLangClass                   groovyConstant
+  GroovyHiLink groovyJavaLangClass               groovyExternal
+  GroovyHiLink groovyJavaLangObject              groovyConstant
+  syn cluster groovyTop add=groovyJavaLangObject,groovyJavaLangClass,groovyLangClass
+  syn cluster groovyClasses add=groovyJavaLangClass,groovyLangClass
+endif
+
+
+" Groovy stuff
+syn match groovyOperator "\.\."
+syn match groovyOperator "<\{2,3}"
+syn match groovyOperator ">\{2,3}"
+syn match groovyOperator "->"
+syn match groovyExternal		'^#!.*[/\\]groovy\>'
+syn match groovyExceptions        "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
+
+" Groovy JDK stuff
+syn keyword groovyJDKBuiltin    as def in
+syn keyword groovyJDKOperOverl  div minus plus abs round power multiply 
+syn keyword groovyJDKMethods 	each call inject sort print println 
+syn keyword groovyJDKMethods    getAt putAt size push pop toList getText writeLine eachLine readLines
+syn keyword groovyJDKMethods    withReader withStream withWriter withPrintWriter write read leftShift 
+syn keyword groovyJDKMethods    withWriterAppend readBytes splitEachLine
+syn keyword groovyJDKMethods    newInputStream newOutputStream newPrintWriter newReader newWriter 
+syn keyword groovyJDKMethods    compareTo next previous isCase 
+syn keyword groovyJDKMethods    times step toInteger upto any collect dump every find findAll grep
+syn keyword groovyJDKMethods    inspect invokeMethods join 
+syn keyword groovyJDKMethods    getErr getIn getOut waitForOrKill
+syn keyword groovyJDKMethods    count tokenize asList flatten immutable intersect reverse reverseEach
+syn keyword groovyJDKMethods    subMap append asWritable eachByte eachLine eachFile 
+syn cluster groovyTop add=groovyJDKBuiltin,groovyJDKOperOverl,groovyJDKMethods
+
+" no useful I think, so I comment it..
+"if filereadable(expand("<sfile>:p:h")."/groovyid.vim")
+ " source <sfile>:p:h/groovyid.vim
+"endif
+
+if exists("groovy_space_errors")
+  if !exists("groovy_no_trail_space_error")
+    syn match   groovySpaceError  "\s\+$"
+  endif
+  if !exists("groovy_no_tab_space_error")
+    syn match   groovySpaceError  " \+\t"me=e-1
+  endif
+endif
+
+" it is a better case construct than java.vim to match groovy syntax
+syn region  groovyLabelRegion     transparent matchgroup=groovyLabel start="\<case\>" matchgroup=NONE end=":\|$" contains=groovyNumber,groovyString,groovyLangClass,groovyJavaLangClass
+syn match   groovyUserLabel       "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=groovyLabel
+syn keyword groovyLabel           default
+
+if !exists("groovy_allow_cpp_keywords")
+  syn keyword groovyError auto delete extern friend inline redeclared
+  syn keyword groovyError register signed sizeof struct template typedef union
+  syn keyword groovyError unsigned operator
+endif
+
+" The following cluster contains all groovy groups except the contained ones
+syn cluster groovyTop add=groovyExternal,groovyError,groovyError,groovyBranch,groovyLabelRegion,groovyLabel,groovyConditional,groovyRepeat,groovyBoolean,groovyConstant,groovyTypedef,groovyOperator,groovyType,groovyType,groovyStatement,groovyStorageClass,groovyAssert,groovyExceptions,groovyMethodDecl,groovyClassDecl,groovyClassDecl,groovyClassDecl,groovyScopeDecl,groovyError,groovyError2,groovyUserLabel,groovyLangObject
+
+
+" Comments
+syn keyword groovyTodo             contained TODO FIXME XXX
+if exists("groovy_comment_strings")
+  syn region  groovyCommentString    contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=groovySpecial,groovyCommentStar,groovySpecialChar,@Spell
+  syn region  groovyComment2String   contained start=+"+  end=+$\|"+  contains=groovySpecial,groovySpecialChar,@Spell
+  syn match   groovyCommentCharacter contained "'\\[^']\{1,6\}'" contains=groovySpecialChar
+  syn match   groovyCommentCharacter contained "'\\''" contains=groovySpecialChar
+  syn match   groovyCommentCharacter contained "'[^\\]'"
+  syn cluster groovyCommentSpecial add=groovyCommentString,groovyCommentCharacter,groovyNumber
+  syn cluster groovyCommentSpecial2 add=groovyComment2String,groovyCommentCharacter,groovyNumber
+endif
+syn region  groovyComment          start="/\*"  end="\*/" contains=@groovyCommentSpecial,groovyTodo,@Spell
+syn match   groovyCommentStar      contained "^\s*\*[^/]"me=e-1
+syn match   groovyCommentStar      contained "^\s*\*$"
+syn match   groovyLineComment      "//.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
+syn match   groovyLineComment      "#.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
+GroovyHiLink groovyCommentString groovyString
+GroovyHiLink groovyComment2String groovyString
+GroovyHiLink groovyCommentCharacter groovyCharacter
+
+syn cluster groovyTop add=groovyComment,groovyLineComment
+
+if !exists("groovy_ignore_groovydoc") && main_syntax != 'jsp'
+  syntax case ignore
+  " syntax coloring for groovydoc comments (HTML)
+  " syntax include @groovyHtml <sfile>:p:h/html.vim
+   syntax include @groovyHtml runtime! syntax/html.vim
+  unlet b:current_syntax
+  syn region  groovyDocComment    start="/\*\*"  end="\*/" keepend contains=groovyCommentTitle,@groovyHtml,groovyDocTags,groovyTodo,@Spell
+  syn region  groovyCommentTitle  contained matchgroup=groovyDocComment start="/\*\*"   matchgroup=groovyCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@groovyHtml,groovyCommentStar,groovyTodo,@Spell,groovyDocTags
+
+  syn region groovyDocTags  contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
+  syn match  groovyDocTags  contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=groovyDocParam
+  syn match  groovyDocParam contained "\s\S\+"
+  syn match  groovyDocTags  contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
+  syntax case match
+endif
+
+" match the special comment /**/
+syn match   groovyComment          "/\*\*/"
+
+" Strings and constants
+syn match   groovySpecialError     contained "\\."
+syn match   groovySpecialCharError contained "[^']"
+syn match   groovySpecialChar      contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
+syn region  groovyString          start=+"+ end=+"+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
+syn region  groovyString          start=+'+ end=+'+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
+" syn region groovyELExpr start=+${+ end=+}+ keepend contained
+ syn match groovyELExpr /\${.\{-}}/ contained
+GroovyHiLink groovyELExpr Identifier
+
+" TODO: better matching. I am waiting to understand how it really works in groovy
+" syn region  groovyClosureParamsBraces          start=+|+ end=+|+ contains=groovyClosureParams
+" syn match groovyClosureParams	"[ a-zA-Z0-9_*]\+" contained
+" GroovyHiLink groovyClosureParams Identifier
+
+" next line disabled, it can cause a crash for a long line
+"syn match   groovyStringError      +"\([^"\\]\|\\.\)*$+
+
+" disabled: in groovy strings or characters are written the same
+" syn match   groovyCharacter        "'[^']*'" contains=groovySpecialChar,groovySpecialCharError
+" syn match   groovyCharacter        "'\\''" contains=groovySpecialChar
+" syn match   groovyCharacter        "'[^\\]'"
+syn match   groovyNumber           "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+syn match   groovyNumber           "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+syn match   groovyNumber           "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+syn match   groovyNumber           "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+
+" unicode characters
+syn match   groovySpecial "\\u\d\{4\}"
+
+syn cluster groovyTop add=groovyString,groovyCharacter,groovyNumber,groovySpecial,groovyStringError
+
+if exists("groovy_highlight_functions")
+  if groovy_highlight_functions == "indent"
+    syn match  groovyFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
+    syn region groovyFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
+    syn match  groovyFuncDef "^  [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
+    syn region groovyFuncDef start=+^  [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
+  else
+    " This line catches method declarations at any indentation>0, but it assumes
+    " two things:
+    "   1. class names are always capitalized (ie: Button)
+    "   2. method names are never capitalized (except constructors, of course)
+    syn region groovyFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,groovyComment,groovyLineComment,@groovyClasses
+  endif
+  syn match  groovyBraces  "[{}]"
+  syn cluster groovyTop add=groovyFuncDef,groovyBraces
+endif
+
+if exists("groovy_highlight_debug")
+
+  " Strings and constants
+  syn match   groovyDebugSpecial          contained "\\\d\d\d\|\\."
+  syn region  groovyDebugString           contained start=+"+  end=+"+  contains=groovyDebugSpecial
+  syn match   groovyDebugStringError      +"\([^"\\]\|\\.\)*$+
+  syn match   groovyDebugCharacter        contained "'[^\\]'"
+  syn match   groovyDebugSpecialCharacter contained "'\\.'"
+  syn match   groovyDebugSpecialCharacter contained "'\\''"
+  syn match   groovyDebugNumber           contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+  syn match   groovyDebugNumber           contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+  syn match   groovyDebugNumber           contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+  syn match   groovyDebugNumber           contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+  syn keyword groovyDebugBoolean          contained true false
+  syn keyword groovyDebugType             contained null this super
+  syn region groovyDebugParen  start=+(+ end=+)+ contained contains=groovyDebug.*,groovyDebugParen
+
+  " to make this work you must define the highlighting for these groups
+  syn match groovyDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
+  syn match groovyDebug "\<p\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
+  syn match groovyDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
+  syn match groovyDebug "\<trace[SL]\=\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
+
+  syn cluster groovyTop add=groovyDebug
+
+  if version >= 508 || !exists("did_c_syn_inits")
+    GroovyHiLink groovyDebug                 Debug
+    GroovyHiLink groovyDebugString           DebugString
+    GroovyHiLink groovyDebugStringError      groovyError
+    GroovyHiLink groovyDebugType             DebugType
+    GroovyHiLink groovyDebugBoolean          DebugBoolean
+    GroovyHiLink groovyDebugNumber           Debug
+    GroovyHiLink groovyDebugSpecial          DebugSpecial
+    GroovyHiLink groovyDebugSpecialCharacter DebugSpecial
+    GroovyHiLink groovyDebugCharacter        DebugString
+    GroovyHiLink groovyDebugParen            Debug
+  
+    GroovyHiLink DebugString               String
+    GroovyHiLink DebugSpecial              Special
+    GroovyHiLink DebugBoolean              Boolean
+    GroovyHiLink DebugType                 Type
+  endif
+endif
+
+" Match all Exception classes 
+syn match groovyExceptions        "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
+
+
+if !exists("groovy_minlines")
+  let groovy_minlines = 10
+endif
+exec "syn sync ccomment groovyComment minlines=" . groovy_minlines
+
+
+" ################### 
+" Groovy stuff
+" syn match groovyOperator		"|[ ,a-zA-Z0-9_*]\+|"
+
+" All groovy valid tokens
+" syn match groovyTokens ";\|,\|<=>\|<>\|:\|:=\|>\|>=\|=\|==\|<\|<=\|!=\|/\|/=\|\.\.|\.\.\.\|\~=\|\~=="
+" syn match groovyTokens "\*=\|&\|&=\|\*\|->\|\~\|+\|-\|/\|?\|<<<\|>>>\|<<\|>>"
+
+" Must put explicit these ones because groovy.vim mark them as errors otherwise
+" syn match groovyTokens "<=>\|<>\|==\~"
+"syn cluster groovyTop add=groovyTokens
+
+" Mark these as operators
+
+" Hightlight brackets
+" syn match  groovyBraces		"[{}]"
+" syn match  groovyBraces		"[\[\]]"
+" syn match  groovyBraces		"[\|]"
+
+if exists("groovy_mark_braces_in_parens_as_errors")
+  syn match groovyInParen          contained "[{}]"
+  GroovyHiLink groovyInParen        groovyError
+  syn cluster groovyTop add=groovyInParen
+endif
+
+" catch errors caused by wrong parenthesis
+syn region  groovyParenT  transparent matchgroup=groovyParen  start="("  end=")" contains=@groovyTop,groovyParenT1
+syn region  groovyParenT1 transparent matchgroup=groovyParen1 start="(" end=")" contains=@groovyTop,groovyParenT2 contained
+syn region  groovyParenT2 transparent matchgroup=groovyParen2 start="(" end=")" contains=@groovyTop,groovyParenT  contained
+syn match   groovyParenError       ")"
+GroovyHiLink groovyParenError       groovyError
+
+" catch errors caused by wrong square parenthesis
+syn region  groovyParenT  transparent matchgroup=groovyParen  start="\["  end="\]" contains=@groovyTop,groovyParenT1
+syn region  groovyParenT1 transparent matchgroup=groovyParen1 start="\[" end="\]" contains=@groovyTop,groovyParenT2 contained
+syn region  groovyParenT2 transparent matchgroup=groovyParen2 start="\[" end="\]" contains=@groovyTop,groovyParenT  contained
+syn match   groovyParenError       "\]"
+
+" ###############################
+" java.vim default highlighting
+if version >= 508 || !exists("did_groovy_syn_inits")
+  if version < 508
+    let did_groovy_syn_inits = 1
+  endif
+  GroovyHiLink groovyFuncDef		Function
+  GroovyHiLink groovyBraces		Function
+  GroovyHiLink groovyBranch		Conditional
+  GroovyHiLink groovyUserLabelRef	groovyUserLabel
+  GroovyHiLink groovyLabel		Label
+  GroovyHiLink groovyUserLabel		Label
+  GroovyHiLink groovyConditional	Conditional
+  GroovyHiLink groovyRepeat		Repeat
+  GroovyHiLink groovyExceptions		Exception
+  GroovyHiLink groovyAssert 		Statement
+  GroovyHiLink groovyStorageClass	StorageClass
+  GroovyHiLink groovyMethodDecl		groovyStorageClass
+  GroovyHiLink groovyClassDecl		groovyStorageClass
+  GroovyHiLink groovyScopeDecl		groovyStorageClass
+  GroovyHiLink groovyBoolean		Boolean
+  GroovyHiLink groovySpecial		Special
+  GroovyHiLink groovySpecialError	Error
+  GroovyHiLink groovySpecialCharError	Error
+  GroovyHiLink groovyString		String
+  GroovyHiLink groovyCharacter		Character
+  GroovyHiLink groovySpecialChar	SpecialChar
+  GroovyHiLink groovyNumber		Number
+  GroovyHiLink groovyError		Error
+  GroovyHiLink groovyStringError	Error
+  GroovyHiLink groovyStatement		Statement
+  GroovyHiLink groovyOperator		Operator
+  GroovyHiLink groovyComment		Comment
+  GroovyHiLink groovyDocComment		Comment
+  GroovyHiLink groovyLineComment	Comment
+  GroovyHiLink groovyConstant		Constant
+  GroovyHiLink groovyTypedef		Typedef
+  GroovyHiLink groovyTodo		Todo
+  
+  GroovyHiLink groovyCommentTitle	SpecialComment
+  GroovyHiLink groovyDocTags		Special
+  GroovyHiLink groovyDocParam		Function
+  GroovyHiLink groovyCommentStar	groovyComment
+  
+  GroovyHiLink groovyType		Type
+  GroovyHiLink groovyExternal		Include
+  
+  GroovyHiLink htmlComment		Special
+  GroovyHiLink htmlCommentPart		Special
+  GroovyHiLink groovySpaceError		Error
+  GroovyHiLink groovyJDKBuiltin         Special
+  GroovyHiLink groovyJDKOperOverl       Operator
+  GroovyHiLink groovyJDKMethods         Function
+endif
+
+delcommand GroovyHiLink
+
+
+let b:current_syntax = "groovy"
+if main_syntax == 'groovy'
+  unlet main_syntax
+endif
+
+let b:spell_options="contained"
+
+" vim: ts=8
diff --git a/trymcp-day01-image/files/root/.vim/syntax/jinja.vim b/trymcp-day01-image/files/root/.vim/syntax/jinja.vim
new file mode 100644
index 0000000..637b261
--- /dev/null
+++ b/trymcp-day01-image/files/root/.vim/syntax/jinja.vim
@@ -0,0 +1,141 @@
+" Vim syntax file
+" Language:	Jinja template
+" Maintainer:	Armin Ronacher <armin.ronacher@active-4.com>
+" Last Change:	2008 May 9
+" Version:      1.1
+"
+" Known Bugs:
+"   because of odd limitations dicts and the modulo operator
+"   appear wrong in the template.
+"
+" Changes:
+"
+"     2008 May 9:     Added support for Jinja2 changes (new keyword rules)
+
+" .vimrc variable to disable html highlighting
+if !exists('g:jinja_syntax_html')
+   let g:jinja_syntax_html=1
+endif
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+    finish
+  endif
+  let main_syntax = 'jinja'
+endif
+
+" Pull in the HTML syntax.
+if g:jinja_syntax_html
+  if version < 600
+    so <sfile>:p:h/html.vim
+  else
+    let ext = expand('%:e')
+    if ext !~ 'htm\|nunj|jinja\|j2' &&
+          \ findfile(ext . '.vim', $VIMRUNTIME . '/syntax') != ''
+      execute 'runtime! syntax/' . ext . '.vim'
+    else
+      runtime! syntax/html.vim
+    endif
+    unlet b:current_syntax
+  endif
+endif
+
+syntax case match
+
+" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
+" have special threatment)
+syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
+
+syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
+syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
+syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
+
+" Variable Names
+syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/
+syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs
+
+" Filters
+syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter
+syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/
+syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/
+syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/
+
+" Jinja template constants
+syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/
+syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/
+syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
+
+" Operators
+syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
+syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
+syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
+syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
+
+" Jinja template tag and variable blocks
+syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
+syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
+syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
+syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
+
+syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
+
+" Jinja template 'raw' tag
+syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
+
+" Jinja comments
+syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
+
+" Block start keywords.  A bit tricker.  We only highlight at the start of a
+" tag block and only if the name is not followed by a comma or equals sign
+" which usually means that we have to deal with an assignment.
+syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
+
+" and context modifiers
+syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jinja_syn_inits")
+  if version < 508
+    let did_jinja_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink jinjaPunctuation jinjaOperator
+  HiLink jinjaAttribute jinjaVariable
+  HiLink jinjaFunction jinjaFilter
+
+  HiLink jinjaTagDelim jinjaTagBlock
+  HiLink jinjaVarDelim jinjaVarBlock
+  HiLink jinjaCommentDelim jinjaComment
+  HiLink jinjaRawDelim jinja
+
+  HiLink jinjaSpecial Special
+  HiLink jinjaOperator Normal
+  HiLink jinjaRaw Normal
+  HiLink jinjaTagBlock PreProc
+  HiLink jinjaVarBlock PreProc
+  HiLink jinjaStatement Statement
+  HiLink jinjaFilter Function
+  HiLink jinjaBlockName Function
+  HiLink jinjaVariable Identifier
+  HiLink jinjaString Constant
+  HiLink jinjaNumber Constant
+  HiLink jinjaComment Comment
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "jinja"
+
+if main_syntax == 'jinja'
+  unlet main_syntax
+endif
diff --git a/trymcp-day01-image/files/root/.vimrc b/trymcp-day01-image/files/root/.vimrc
new file mode 100644
index 0000000..3ccc319
--- /dev/null
+++ b/trymcp-day01-image/files/root/.vimrc
@@ -0,0 +1,71 @@
+syntax on
+set t_Co=256
+set background=dark
+""" https://www.vim.org/scripts/script.php?script_id=945
+au BufRead,BufNewFile *.groovy  setf groovy
+if did_filetype()
+  finish
+endif
+if getline(1) =~ '^#!.*[/\\]groovy\>'
+  setf groovy
+endif
+""" https://raw.githubusercontent.com/Glench/Vim-Jinja2-Syntax/master/syntax/jinja.vim
+au BufRead,BufNewFile *.jinja setfiletype jinja
+au BufRead,BufNewFile *.sls setfiletype jinja
+"""
+au BufRead,BufNewFile *.lio setfiletype yaml
+""" syntaxer
+set ignorecase
+set hlsearch
+set nocompatible
+set backspace=2
+inoremap ^? ^H
+set ruler
+set showcmd
+set gdefault
+set nobackup
+set nodigraph
+set incsearch
+set nojoinspaces
+set laststatus=2
+set tabstop=2
+set bg=light
+set bs=2
+
+function! TrimWhiteSpace()
+    %s/\s\+$//e
+endfunction
+highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
+match ExtraWhitespace /\s\+$/
+match ExtraWhitespace /\s\+\%#\@<!$/
+match ExtraWhitespace /\s\+$/
+autocmd ColorScheme * highlight WhiteSpaces gui=undercurl guifg=LightGray | match WhiteSpaces / \+/
+
+set viminfo='10,\"100,:20,%,n~/.viminfo
+
+" when we reload, tell vim to restore the cursor to the saved position
+augroup JumpCursorOnEdit
+ au!
+ autocmd BufReadPost *
+ \ if expand("<afile>:p:h") !=? $TEMP |
+ \ if line("'\"") > 1 && line("'\"") <= line("$") |
+ \ let JumpCursorOnEdit_foo = line("'\"") |
+ \ let b:doopenfold = 1 |
+ \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
+ \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
+ \ let b:doopenfold = 2 |
+ \ endif |
+ \ exe JumpCursorOnEdit_foo |
+ \ endif |
+ \ endif
+ " Need to postpone using "zv" until after reading the modelines.
+ autocmd BufWinEnter *
+ \ if exists("b:doopenfold") |
+ \ exe "normal zv" |
+ \ if(b:doopenfold > 1) |
+ \ exe "+".1 |
+ \ endif |
+ \ unlet b:doopenfold |
+ \ endif
+augroup END
+
diff --git a/trymcp-day01-image/files/root/interfaces b/trymcp-day01-image/files/root/interfaces
new file mode 100644
index 0000000..97aaea3
--- /dev/null
+++ b/trymcp-day01-image/files/root/interfaces
@@ -0,0 +1,21 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+source /etc/network/interfaces.d/*
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+auto ens3
+iface ens3 inet static
+  address $SALT_MASTER_DEPLOY_IP
+  netmask $DEPLOY_NETWORK_NETMASK
+  gateway $DEPLOY_NETWORK_GW
+  mtu $DEPLOY_NETWORK_MTU
+  dns-nameservers $DNS_SERVERS
+#auto ens4
+#iface ens4 inet static
+#  address $SALT_MASTER_CONTROL_IP
+#  netmask $SALT_MASTER_CONTROL_NETMASK
diff --git a/trymcp-day01-image/files/root/minion.conf b/trymcp-day01-image/files/root/minion.conf
new file mode 100644
index 0000000..7aef667
--- /dev/null
+++ b/trymcp-day01-image/files/root/minion.conf
@@ -0,0 +1,27 @@
+# Predefined config-file
+# Passed via packer-templates
+
+master: $SALT_MASTER_DEPLOY_IP
+
+id: $SALT_MASTER_MINION_ID
+
+max_event_size: 100000000
+acceptance_wait_time_max: 60
+acceptance_wait_time: 10
+random_reauth_delay: 270
+recon_default: 1000
+recon_max: 60000
+recon_randomize: True
+
+auth_timeout: 60
+
+grains_dirs:
+- /var/lib/salt/grains
+
+mine_functions:
+  network.interfaces: []
+  grains.items: []
+mine_interval: 60
+log_level: info
+
+state_output: changes
diff --git a/trymcp-day01-image/run.example.sh b/trymcp-day01-image/run.example.sh
new file mode 100755
index 0000000..4fafb55
--- /dev/null
+++ b/trymcp-day01-image/run.example.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# pre-requirments:
+# apt-get install cloud-localds
+# Cloudimg: wget https://cloud-images.ubuntu.com/xenial/XXXX/xenial-server-cloudimg-amd64-disk1.img
+# Packer: https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip
+
+# Those script - only example for variables, which should be passed to packer and
+# overwrite variables under /scripts/ directory
+
+# External script sources:
+# http/bootstrap.saltstack.com.sh https://github.com/saltstack/salt-bootstrap
+#
+export IMAGE_NAME="trymcp"
+#
+export APT_MIRANTIS_GPG="http://apt.mirantis.com/public.gpg"
+export APT_MIRANTIS_SALT_REPO="http://apt.mirantis.com/xenial/ nightly salt"
+export APT_REPOSITORY="deb [arch=amd64] http://apt.mirantis.com/xenial/ proposed salt"
+export APT_REPOSITORY_GPG="http://apt.mirantis.com/public.gpg"
+export CLUSTER_MODEL="https://github.com/LotharKAtt/trymcp-drivetrain-model.git"
+export CLUSTER_MODEL_REF="master"
+export CLUSTER_NAME="try-mcp"
+export FORMULA_VERSION="nightly"
+export GIT_SALT_FORMULAS_SCRIPTS="https://github.com/salt-formulas/salt-formulas-scripts.git"
+export MCP_VERSION="proposed"
+export SALTSTACK_GPG="https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub"
+export SALTSTACK_REPO="http://mirror.mirantis.com/proposed/saltstack-2017.7/xenial xenial main"
+export SCRIPTS_REF="master"
+export UBUNTU_BASEURL="http://mirror.mirantis.com/proposed/ubuntu/"
+export BINARY_MCP_VERSION="proposed"
+
+###
+# Hard-coded folder in template
+export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
+mkdir -p "${PACKER_IMAGES_CACHE}"
+
+export PACKER_LOG=1
+# For qemu test-build:
+cloud-localds  --hostname ubuntu --dsmode local config-drive/cloudata.iso  config-drive/user-data.yaml
+packer build -only=qemu -parallel=false -on-error=ask template.json
+#rm -rf ~/.packer.d/
diff --git a/trymcp-day01-image/scripts/base.sh b/trymcp-day01-image/scripts/base.sh
new file mode 120000
index 0000000..140d77f
--- /dev/null
+++ b/trymcp-day01-image/scripts/base.sh
@@ -0,0 +1 @@
+../../common/ubuntu_base.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/base_set_hostname.sh b/trymcp-day01-image/scripts/base_set_hostname.sh
new file mode 120000
index 0000000..f289bc5
--- /dev/null
+++ b/trymcp-day01-image/scripts/base_set_hostname.sh
@@ -0,0 +1 @@
+../../day01-image/scripts/base_set_hostname.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/cleanup.sh b/trymcp-day01-image/scripts/cleanup.sh
new file mode 120000
index 0000000..cf970b6
--- /dev/null
+++ b/trymcp-day01-image/scripts/cleanup.sh
@@ -0,0 +1 @@
+../../common/ubuntu_cleanup.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/cleanup_day01.sh b/trymcp-day01-image/scripts/cleanup_day01.sh
new file mode 120000
index 0000000..27df992
--- /dev/null
+++ b/trymcp-day01-image/scripts/cleanup_day01.sh
@@ -0,0 +1 @@
+../../day01-image/scripts/cleanup_day01.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/cleanup_salt.sh b/trymcp-day01-image/scripts/cleanup_salt.sh
new file mode 120000
index 0000000..72d6f4e
--- /dev/null
+++ b/trymcp-day01-image/scripts/cleanup_salt.sh
@@ -0,0 +1 @@
+../../common/ubuntu_cleanup_salt.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/info.sh b/trymcp-day01-image/scripts/info.sh
new file mode 120000
index 0000000..772d054
--- /dev/null
+++ b/trymcp-day01-image/scripts/info.sh
@@ -0,0 +1 @@
+../../common/ubuntu_info.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/motd.sh b/trymcp-day01-image/scripts/motd.sh
new file mode 120000
index 0000000..aa1f429
--- /dev/null
+++ b/trymcp-day01-image/scripts/motd.sh
@@ -0,0 +1 @@
+../../day01-image/scripts/motd.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/network.sh b/trymcp-day01-image/scripts/network.sh
new file mode 120000
index 0000000..ab1de37
--- /dev/null
+++ b/trymcp-day01-image/scripts/network.sh
@@ -0,0 +1 @@
+../../common/ubuntu_network.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/reboot.sh b/trymcp-day01-image/scripts/reboot.sh
new file mode 120000
index 0000000..4869384
--- /dev/null
+++ b/trymcp-day01-image/scripts/reboot.sh
@@ -0,0 +1 @@
+../../common/ubuntu_reboot.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/salt.sh b/trymcp-day01-image/scripts/salt.sh
new file mode 100644
index 0000000..51eea35
--- /dev/null
+++ b/trymcp-day01-image/scripts/salt.sh
@@ -0,0 +1,39 @@
+#!/bin/bash -xe
+
+FORMULA_VERSION=${FORMULA_VERSION:-2018.3.1}
+APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
+SALT_OPTS="-t 10 --retcode-passthrough --no-color"
+
+echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list
+apt-get update
+apt-get install salt-formula* -y
+
+# Basic states
+salt-call saltutil.clear_cache
+salt-call saltutil.refresh_pillar
+salt-call saltutil.sync_all
+salt-call ${SALT_OPTS} reclass.validate_pillar
+
+salt-call ${SALT_OPTS} state.sls linux.system.repo,linux.system.package,linux.system.user,linux.system.directory,linux.system.config
+salt-call ${SALT_OPTS} state.sls linux.network
+salt-call ${SALT_OPTS} state.sls salt.minion.ca
+
+salt-call ${SALT_OPTS} state.sls salt
+salt-call ${SALT_OPTS} state.sls docker.host
+salt-call ${SALT_OPTS} saltutil.sync_all
+
+docker pull docker-prod-local.artifactory.mirantis.com/mirantis/cicd/mysql:2018.8.0
+docker pull docker-prod-local.artifactory.mirantis.com/mirantis/cicd/gerrit:2018.8.0
+docker pull docker-prod-local.artifactory.mirantis.com/mirantis/cicd/jenkins:2018.8.0
+# FIXME: workaround for missing packages in jenkins slave image
+#docker pull docker-prod-local.artifactory.mirantis.com/mirantis/cicd/jnlp-slave:2018.8.0
+docker pull quay.io/lotharkatt/jenkins-slave:latest
+docker pull docker-prod-local.artifactory.mirantis.com/mirantis/cicd/phpldapadmin:2018.8.0
+docker pull jboss/keycloak:4.5.0.Final
+docker pull jboss/keycloak-proxy:3.4.2.Final
+docker pull mirantis/python-operations-api:latest
+docker pull cockroachdb/cockroach:latest
+docker pull mirantis/operations-ui:latest
+echo "---------------------"
+docker images
+echo "---------------------"
diff --git a/trymcp-day01-image/scripts/salt_bootstrap.sh b/trymcp-day01-image/scripts/salt_bootstrap.sh
new file mode 120000
index 0000000..fd4ae2b
--- /dev/null
+++ b/trymcp-day01-image/scripts/salt_bootstrap.sh
@@ -0,0 +1 @@
+../../common/ubuntu_salt_bootstrap.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/security.sh b/trymcp-day01-image/scripts/security.sh
new file mode 120000
index 0000000..3bd840a
--- /dev/null
+++ b/trymcp-day01-image/scripts/security.sh
@@ -0,0 +1 @@
+../../common/ubuntu_security.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/scripts/zerodisk.sh b/trymcp-day01-image/scripts/zerodisk.sh
new file mode 120000
index 0000000..7a54d04
--- /dev/null
+++ b/trymcp-day01-image/scripts/zerodisk.sh
@@ -0,0 +1 @@
+../../common/zerodisk.sh
\ No newline at end of file
diff --git a/trymcp-day01-image/template.json b/trymcp-day01-image/template.json
new file mode 100644
index 0000000..72ff9e0
--- /dev/null
+++ b/trymcp-day01-image/template.json
@@ -0,0 +1,136 @@
+{
+  "variables": {
+    "user": "root",
+    "password": "r00tme",
+    "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
+    "disk_size": "50000",
+    "do_api_token": "{{ env `DO_API_TOKEN` }}",
+    "image_name": "{{ env `IMAGE_NAME` }}",
+    "cluster_model": "{{ env `CLUSTER_MODEL` }}",
+    "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
+    "cluster_name": "{{ env `CLUSTER_NAME` }}",
+    "bs_hostname": "cfg01",
+    "formula_version": "{{ env `FORMULA_VERSION` }}",
+    "mcp_version": "{{ env `MCP_VERSION` }}",
+    "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
+    "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
+    "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
+    "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
+    "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
+    "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
+    "apt_repository": "{{ env `APT_REPOSITORY` }}",
+    "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}"
+  },
+  "provisioners": [
+    {
+      "type": "file",
+      "source": "files/root/",
+      "destination": "/root"
+    },
+    {
+      "type": "file",
+      "source": "files/opt/bootstrap.saltstack.com.sh",
+      "destination": "/opt/bootstrap.saltstack.com.sh"
+    },
+    {
+      "environment_vars": [
+        "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
+        "PACKER_OFFLINE_BUILD=true"
+      ],
+      "type": "shell",
+      "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
+      "expect_disconnect": "true",
+      "scripts": [
+        "scripts/base_set_hostname.sh",
+        "scripts/base.sh",
+        "scripts/motd.sh",
+        "scripts/network.sh",
+        "scripts/reboot.sh"
+      ]
+    },
+    {
+      "environment_vars": [
+        "CLUSTER_MODEL={{ user `cluster_model` }}",
+        "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
+        "CLUSTER_NAME={{ user `cluster_name` }}",
+        "BS_HOSTNAME={{ user `bs_hostname` }}",
+        "FORMULA_VERSION={{ user `formula_version` }}",
+        "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
+        "SALTSTACK_REPO={{ user `saltstack_repo` }}",
+        "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
+        "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
+        "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
+        "APT_REPOSITORY={{ user `apt_repository` }}",
+        "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
+        "FORMULA_VERSION={{ user `formula_version` }}",
+        "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
+        "BOOTSTRAP_SALTSTACK_COM=file:///opt/bootstrap.saltstack.com.sh",
+        "PACKER_OFFLINE_BUILD=true"
+      ],
+      "type": "shell",
+      "pause_before": "60s",
+      "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
+      "expect_disconnect": "true",
+      "scripts": [
+        "scripts/salt_bootstrap.sh",
+        "scripts/salt.sh"
+      ]
+    },
+    {
+      "environment_vars": [
+        "HOME=/root",
+        "MCP_VERSION={{ user `mcp_version` }}"
+      ],
+      "type": "shell",
+      "pause_before": "10s",
+      "scripts": [
+        "scripts/security.sh",
+        "scripts/info.sh",
+        "scripts/zerodisk.sh"
+      ]
+    },
+    {
+      "type": "file",
+      "source": "files/etc/",
+      "destination": "/etc"
+    }
+  ],
+  "builders": [
+    {
+      "type": "qemu",
+      "qemuargs": [
+        [
+          "-m",
+          "8096M"
+        ],
+        [
+          "-fda",
+          "config-drive/cloudata.iso"
+        ],
+        [
+          "-smp",
+          "4"
+        ]
+      ],
+      "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\"  }}",
+      "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\"  }}",
+      "format": "qcow2",
+      "disk_compression": true,
+      "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
+      "iso_checksum_type": "md5",
+      "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
+      "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
+      "disk_image": true,
+      "accelerator": "kvm",
+      "disk_size": "{{ user `disk_size`}}",
+      "headless": true,
+      "ssh_username": "{{user `user`}}",
+      "ssh_password": "{{user `password`}}",
+      "ssh_host_port_min": 7000,
+      "ssh_host_port_max": 7050,
+      "shutdown_command": "shutdown -P now",
+      "boot_wait": "2s",
+      "ssh_wait_timeout": "360s"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/trymcp-day01-image/template.json.env b/trymcp-day01-image/template.json.env
new file mode 100644
index 0000000..fb05cc3
--- /dev/null
+++ b/trymcp-day01-image/template.json.env
@@ -0,0 +1 @@
+PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"