update example script
This commit is contained in:
parent
6dcb5b3bf4
commit
7fc109842d
|
@ -2,22 +2,26 @@ zones:
|
|||
- name: internet
|
||||
settings:
|
||||
configuration:
|
||||
network: 192.168.1.0/24
|
||||
host_start: 192.168.1.10
|
||||
host_stop: 192.168.1.100
|
||||
host:
|
||||
network: 192.168.1.0/24
|
||||
start: 192.168.1.10
|
||||
stop: 192.168.1.100
|
||||
dns: [192.168.1.2]
|
||||
vlan_id: 192
|
||||
gateway: 192.168.1.254
|
||||
|
||||
clusters:
|
||||
- name: cluster.cadoles.com
|
||||
- name: hapy.ac-test.fr
|
||||
zone: internet
|
||||
zones: [internet]
|
||||
settings:
|
||||
configuration:
|
||||
network:
|
||||
virtual_ip: 192.168.1.1
|
||||
virtual_ip: 192.168.1.1
|
||||
opennebula:
|
||||
one_user: eoleone
|
||||
one_password: eole
|
||||
nodes:
|
||||
- name: node1.cadoles.com
|
||||
zones: [internet]
|
||||
|
||||
servermodels:
|
||||
- name: unbound
|
||||
|
|
|
@ -34,31 +34,35 @@ cucchiaiata-cli v1.user.role.create --user_login gnunux \
|
|||
cucchiaiata-cli v1.infra.zone.create --zone_name internet
|
||||
# zone configuration
|
||||
S=$(get_id "cucchiaiata-cli v1.setting.session.zone.start --zone_name internet")
|
||||
cucchiaiata-cli v1.setting.session.configure --session_id "$S" --configuration.network "192.168.1.0/24" \
|
||||
--configuration.host_start "192.168.1.10" \
|
||||
--configuration.host_stop "192.168.1.100" \
|
||||
cucchiaiata-cli v1.setting.session.configure --session_id "$S" --configuration.host.network "192.168.1.0/24" \
|
||||
--configuration.host.start "192.168.1.10" \
|
||||
--configuration.host.stop "192.168.1.100" \
|
||||
--configuration.dns 192.168.1.2 \
|
||||
--configuration.vlan_id 192 \
|
||||
--configuration.gateway 192.168.1.254
|
||||
cucchiaiata-cli v1.setting.session.validate --session_id $S
|
||||
cucchiaiata-cli v1.setting.session.stop --session_id "$S" --save
|
||||
|
||||
|
||||
# Create the cluster cluster.cadoles.com
|
||||
# Create the cluster hapy.ac-test.fr
|
||||
# +---------------------------+
|
||||
# | cluster.cadoles.com | +~~~~~~~~~~+
|
||||
# | hapy.ac-test.fr | +~~~~~~~~~~+
|
||||
# | +--------------------+ |-------! ZONE !
|
||||
# | | node1.cadoles.com |---|-------! internet !
|
||||
# | +--------------------+ | +~~~~~~~~~~+
|
||||
# +---------------------------+
|
||||
cucchiaiata-cli v1.infra.cluster.create --cluster_name cluster.cadoles.com \
|
||||
--zone_name internet
|
||||
cucchiaiata-cli v1.infra.cluster.create --cluster_name hapy.ac-test.fr \
|
||||
--zone_name internet \
|
||||
--zones_name internet
|
||||
cucchiaiata-cli v1.infra.cluster.node.create --node_name node1.cadoles.com \
|
||||
--cluster_name cluster.cadoles.com \
|
||||
--zones_name internet
|
||||
--cluster_name hapy.ac-test.fr
|
||||
|
||||
# configuration
|
||||
S=$(get_id "cucchiaiata-cli v1.setting.session.cluster.start --cluster_name cluster.cadoles.com")
|
||||
cucchiaiata-cli v1.setting.session.configure --session_id "$S" --configuration.network.virtual_ip "192.168.1.1"
|
||||
S=$(get_id "cucchiaiata-cli v1.setting.session.cluster.start --cluster_name hapy.ac-test.fr")
|
||||
cucchiaiata-cli v1.setting.session.configure --session_id "$S" --configuration.virtual_ip "192.168.1.1"
|
||||
# FIXME endpoint == https://<cluster_name>/RPC2
|
||||
cucchiaiata-cli v1.setting.session.configure --session_id "$S" --configuration.opennebula.one_user "eoleone"
|
||||
cucchiaiata-cli v1.setting.session.configure --session_id "$S" --configuration.opennebula.one_password "eole"
|
||||
cucchiaiata-cli v1.setting.session.validate --session_id $S
|
||||
cucchiaiata-cli v1.setting.session.stop --session_id "$S" --save
|
||||
|
||||
|
@ -128,7 +132,7 @@ cucchiaiata-cli v1.setting.session.stop --session_id "$S" --save
|
|||
# '-> dns.cadoles.com (server)
|
||||
cucchiaiata-cli v1.infra.server.create --server_name dns.cadoles.com \
|
||||
--site_name etab1 \
|
||||
--cluster_name cluster.cadoles.com \
|
||||
--cluster_name hapy.ac-test.fr \
|
||||
--zones_name internet \
|
||||
--servermodel_name unbound_etab1
|
||||
# configuration
|
||||
|
@ -147,11 +151,8 @@ cucchiaiata-cli v1.setting.session.stop --session_id "$S" --save
|
|||
#=======================================================================================================
|
||||
|
||||
# Generate configuration
|
||||
cucchiaiata-cli v1.setting.config.configuration.server.deploy --server_name dns.cadoles.com
|
||||
cucchiaiata-cli v1.setting.template.generate --server_name dns.cadoles.com
|
||||
|
||||
# Generate cluster's configurtion
|
||||
#cucchiaiata-cli v1.provider.configure -c cluster.cadoles.com
|
||||
#cucchiaiata-cli v1.provider.deploy --server dns.cadoles.com
|
||||
cucchiaiata-cli v1.infra.cluster.deploy --cluster_name hapy.ac-test.fr
|
||||
cucchiaiata-cli v1.infra.zone.deploy --zone_name internet
|
||||
cucchiaiata-cli v1.infra.server.deploy --server_name dns.cadoles.com
|
||||
|
||||
echo "fin"
|
||||
|
|
|
@ -33,6 +33,9 @@ class Import(Common):
|
|||
'zone',
|
||||
zone,
|
||||
)
|
||||
self.send('v1.infra.zone.deploy',
|
||||
zone_name=zone['name'],
|
||||
)
|
||||
|
||||
def parse_clusters(self) -> None:
|
||||
for cluster in self.config.get('clusters', []):
|
||||
|
@ -48,6 +51,9 @@ class Import(Common):
|
|||
cluster_name=cluster['name'],
|
||||
zones_name=node['zones'],
|
||||
)
|
||||
self.send('v1.infra.cluster.deploy',
|
||||
cluster_name=cluster['name'],
|
||||
)
|
||||
|
||||
def parse_servermodels(self) -> None:
|
||||
for servermodel in self.config.get('servermodels', []):
|
||||
|
@ -75,10 +81,7 @@ class Import(Common):
|
|||
zones_name=server['zones'],
|
||||
servermodel_name=server['servermodel'],
|
||||
)
|
||||
self.send('v1.setting.config.configuration.server.deploy',
|
||||
server_name=server['name'],
|
||||
)
|
||||
self.send('v1.setting.template.generate',
|
||||
self.send('v1.infra.server.deploy',
|
||||
server_name=server['name'],
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue