Deployed server bootstrap via Heat
authorJames Slagle <jslagle@redhat.com>
Thu, 15 Dec 2016 18:26:38 +0000 (13:26 -0500)
committerJames Slagle <jslagle@redhat.com>
Mon, 16 Jan 2017 15:48:00 +0000 (10:48 -0500)
Adds an environment file, template, and script that can be used to do
initial bootstrapping of deployed servers during NodeExtraConfig. It is
meant to install and configure the initial dependencies needed to apply
the rest of the OpenStack configuration via Heat.

Enabling yum repos and installing the initial python-heat-agent package
would still have to be manual steps when using this environment. But the
goal is to keep those manual steps to a minimum and automate as much as
possible in deployed-server-bootstrap.sh.

Along with setting EnablePackageInstall: True, this could eventually
replace bootstrap-overcloud-full.sh from tripleo-ci.

Partially-implements: blueprint split-stack-software-configuration
Change-Id: I6be94604a46382e6288df1b36b9de8fab58696cc

deployed-server/deployed-server-bootstrap-centos.sh [new file with mode: 0644]
deployed-server/deployed-server-bootstrap-centos.yaml [new file with mode: 0644]
deployed-server/deployed-server.yaml
environments/deployed-server-bootstrap-environment-centos.yaml [new file with mode: 0644]
environments/deployed-server-environment.yaml

diff --git a/deployed-server/deployed-server-bootstrap-centos.sh b/deployed-server/deployed-server-bootstrap-centos.sh
new file mode 100644 (file)
index 0000000..7266ca5
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -eux
+
+yum install -y \
+    jq \
+    python-ipaddr \
+    openstack-puppet-modules \
+    os-net-config \
+    openvswitch \
+    python-heat-agent*
+
+ln -s -f /usr/share/openstack-puppet/modules/* /etc/puppet/modules
+
+setenforce 0
+sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
diff --git a/deployed-server/deployed-server-bootstrap-centos.yaml b/deployed-server/deployed-server-bootstrap-centos.yaml
new file mode 100644 (file)
index 0000000..ac53738
--- /dev/null
@@ -0,0 +1,22 @@
+heat_template_version: 2014-10-16
+
+description: 'Deployed Server Bootstrap Config'
+
+parameters:
+
+  server:
+    type: string
+
+resources:
+
+  DeployedServerBootstrapConfig:
+    type: OS::Heat::SoftwareConfig
+    properties:
+      group: script
+      config: {get_file: deployed-server-bootstrap-centos.sh}
+
+  DeployedServerBootstrapDeployment:
+    type: OS::Heat::SoftwareDeployment
+    properties:
+      config: {get_resource: DeployedServerBootstrapConfig}
+      server: {get_param: server}
index 77968f6..1e8afb2 100644 (file)
@@ -106,6 +106,11 @@ resources:
       config: {get_resource: HostsEntryConfig}
       server: {get_resource: deployed-server}
 
+  DeployedServerBootstrapConfig:
+    type: OS::TripleO::DeployedServer::Bootstrap
+    properties:
+      server: {get_resource: deployed-server}
+
   ControlPlanePort:
     type: OS::TripleO::DeployedServer::ControlPlanePort
     properties:
diff --git a/environments/deployed-server-bootstrap-environment-centos.yaml b/environments/deployed-server-bootstrap-environment-centos.yaml
new file mode 100644 (file)
index 0000000..ebcdfc2
--- /dev/null
@@ -0,0 +1,7 @@
+# An environment that can be used with the deployed-server.yaml template to do
+# initial bootstrapping of the deployed servers.
+resource_registry:
+  OS::TripleO::DeployedServer::Bootstrap: ../deployed-server/deployed-server-bootstrap-centos.yaml
+
+parameter_defaults:
+  EnablePackageInstall: True
index 7a6639f..7bc1bd9 100644 (file)
@@ -1,3 +1,4 @@
 resource_registry:
   OS::TripleO::Server: ../deployed-server/deployed-server.yaml
   OS::TripleO::DeployedServer::ControlPlanePort: OS::Neutron::Port
+  OS::TripleO::DeployedServer::Bootstrap: OS::Heat::None