from .xlate import XLATOR
-__version__ = '3.7.2'
+__version__ = '3.7.3'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
cmd += "--project '{pr}' "
cmd += "--role '{r}' --owner '{o}' --tier '{t}' --purpose '{p}' --email '{m}'"
cmd += " --zone '{z}'"
+ if vm.puppet_initial_install:
+ cmd += " --initial-install"
cmd = cmd.format(
p=purpose, t=vm.puppet_tier, o=vm.customer, c=vm.puppet_customer, z=zone,
pr=vm.puppet_project, m=vm.puppet_contact, e=vm.puppet_env, r=vm.puppet_role)
from .interface import TerraformInterface
-__version__ = '1.6.0'
+__version__ = '1.6.1'
LOG = logging.getLogger(__name__)
cluster=None, boot_delay=None, ds_cluster=None, datastore=None, ds_type=None,
customer=None, rootdisk_size=None, purpose=None, puppet_contact=None, puppet_role=None,
puppet_customer=None, puppet_project=None, puppet_tier=None, puppet_env=None,
- puppet_initial_install=False, vm_template=None, nameservers=None, searchdomains=None,
+ puppet_initial_install=True, vm_template=None, nameservers=None, searchdomains=None,
dns_options=None, has_backup=True, has_puppet=True, already_existing=None,
vsphere=None):
HAS_TTY='y'
HAS_COLORS="n"
-VERSION="1.4"
+VERSION="1.5"
BASENAME="$(basename ${0})"
BASE_DIR="$(dirname ${0})"
PKG_INSTALLED="n"
ROLE="base_oel7"
PROJECT=
+INITIAL_INSTALL="n"
PUPPET_SERVER="puppetmaster.pixelpark.com"
PUPPET_CA_SERVER="puppetca01.pixelpark.com"
#------------------------------------------------------------------------------
description() {
cat <<-EOF
- Initialize a Puppet5 agent and start it.
+ Initialize a Puppet agent and start it.
This script works only for Red Hat Linux and its derivates.
-T|--tier TIER The tier of the production state. If not given,
the Puppet environment will be used.
-R|--role ROLE The Puppet role of the host, Default: '${ROLE}'.
+ -I|--initial-install
+ Set the custom fact initial_install for the first execution
+ of a Puppet agent run after deploying the VM.
-P|--purpose PURPOSE
The purpose of the host, Default: '${PURPOSE}'.
-M|--email MAIL_ADDRESS
local tmp=
local base_dir=
- local short_options="E:C:p:O:T:R:P:M:l:z:dvqhV"
+ local short_options="E:C:p:O:T:R:IP:M:l:z:dvqhV"
local long_options="env:,environment:,customer:,hiera-customer:,project:,owner:,tier:,role:,"
- long_options+="purpose:,server:,ca-server:,email:,location:,zone:,"
+ long_options+="initial-install,purpose:,server:,ca-server:,email:,location:,zone:,"
long_options+="debug,verbose,quiet,help,version"
set +e
shift
shift
;;
+ -I|--initial-install)
+ INITIAL_INSTALL="y"
+ shift
+ ;;
-P|--purpose)
PURPOSE="$2"
shift
debug "Generatet content of '${yfile}':\n${content}"
echo "${content}" > "${yfile}"
- yfile="${facts_dir}/initial_install.yaml"
- info "Generating '${GREEN}${yfile}${NORMAL}' ..."
- content=$( cat <<-EOF
- ---
- initial_install: true
- EOF
- )
- debug "Generatet content of '${yfile}':\n${content}"
- echo "${content}" > "${yfile}"
+ if [[ "${INITIAL_INSTALL}" ]] ; then
+ yfile="${facts_dir}/initial_install.yaml"
+ info "Generating '${GREEN}${yfile}${NORMAL}' ..."
+ content=$( cat <<-EOF
+ ---
+ initial_install: true
+ EOF
+ )
+ debug "Generatet content of '${yfile}':\n${content}"
+ echo "${content}" > "${yfile}"
+ fi
wrong_file="${facts_dir}/host"
if [[ -r "${wrong_file}" ]] ; then