added support for init scripts
Change-Id: I466904341769e7a21f2d5a8501e09250a2bf345d
diff --git a/README.rst b/README.rst
index e56c428..af086fe 100644
--- a/README.rst
+++ b/README.rst
@@ -17,6 +17,7 @@
image_location: http://...
disk_format: qcow2
public_network: INET1
+ saltmaster_ip: 10.0.0.90
avinetworks:
client:
diff --git a/avinetworks/files/avi_init b/avinetworks/files/avi_init
new file mode 100644
index 0000000..2c84220
--- /dev/null
+++ b/avinetworks/files/avi_init
@@ -0,0 +1,2 @@
+#!/bin/bash
+{{ saltmaster }} #saltmaster ip
\ No newline at end of file
diff --git a/avinetworks/server.sls b/avinetworks/server.sls
index 5205f88..7db2734 100644
--- a/avinetworks/server.sls
+++ b/avinetworks/server.sls
@@ -122,6 +122,14 @@
- require:
- keystone: avinetworks_user
+avinetworks_init_script:
+ file.managed:
+ - name: /etc/avi_init.sh
+ - source: salt://avinetworks/files/avi_init
+ - defaults:
+ saltmaster: {{ server.saltmaster_ip }}
+ - template: jinja
+
avinetworks_instance_01:
novang.instance_present:
- profile: {{ server.identity }}
@@ -134,6 +142,7 @@
- networks:
- name: avinetworks
v4_fixed_ip: 10.1.0.10
+ - user_data: /etc/avi_init.sh
- require:
- keystone: avinetworks_user
- novang: avinetworks_flavor
@@ -141,6 +150,7 @@
- neutronng: avinetworks_network
- neutronng: avinetworks_subnet
- neutronng: avinetworks_secgroup
+ - file: avinetworks_init_script
avinetworks_instance_02:
novang.instance_present:
@@ -154,6 +164,7 @@
- networks:
- name: avinetworks
v4_fixed_ip: 10.1.0.11
+ - user_data: /etc/avi_init.sh
- require:
- keystone: avinetworks_user
- novang: avinetworks_flavor
@@ -161,6 +172,7 @@
- neutronng: avinetworks_network
- neutronng: avinetworks_subnet
- neutronng: avinetworks_secgroup
+ - file: avinetworks_init_script
avinetworks_instance_03:
novang.instance_present:
@@ -174,6 +186,7 @@
- networks:
- name: avinetworks
v4_fixed_ip: 10.1.0.12
+ - user_data: /etc/avi_init.sh
- require:
- keystone: avinetworks_user
- novang: avinetworks_flavor
@@ -181,6 +194,7 @@
- neutronng: avinetworks_network
- neutronng: avinetworks_subnet
- neutronng: avinetworks_secgroup
+ - file: avinetworks_init_script
avinetworks_floating_ip_01:
neutronng.floatingip_present:
diff --git a/tests/pillar/server.sls b/tests/pillar/server.sls
index a7383dc..f8adb97 100644
--- a/tests/pillar/server.sls
+++ b/tests/pillar/server.sls
@@ -4,4 +4,5 @@
identity: cloud1
image_location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
disk_format: qcow2
- public_network: INET1
\ No newline at end of file
+ public_network: INET1
+ saltmaster_ip: 10.0.0.90
\ No newline at end of file