Skip to content

Instantly share code, notes, and snippets.

def upgrade_list(self, instructions):
status = self.upgrade_status()
updates = {'roles': [], 'hosts': []}
# parse rolling_rules from instructions
if instructions.get('rolling_rules'):
# reformat upgrade status to be keyed off role
pending = self.key_host_list_off_role(status['pending'])
upgraded = self.key_host_list_off_role(status['upgraded'])
upgrading = self.key_host_list_off_role(status['upgrading'])
# get the upgrade instructions
while true
do
# first install all packages to make the build as fast as possible
puppet apply --detailed-exitcodes \`puppet config print default_manifest\` --config_version='echo packages' --tags package
ret_code_package=\$?
# now perform base config
(echo 'File<| title == "/etc/consul" |> { purge => false }'; echo 'include rjil::jiocloud' ) | puppet apply --config_version='echo bootstrap' --detailed-exitcodes --debug
ret_code_jio=\$?
if [[ \$ret_code_jio = 1 || \$ret_code_jio = 4 || \$ret_code_jio = 6 || \$ret_code_package = 1 || \$ret_code_package = 4 || \$ret_code_package = 6 ]]
then
def parse_report(report_obj)
report = {}
report['start_time'] = report_obj.time
report['status'] = report_obj.status
report['configuration_version'] = report_obj.configuration_version
report['metrics'] = {}
report['resources'] = {}
report_obj.metrics['time'].values.each do |x|
if x[0] == 'total'
ssh_keypair { '/tmp/foo':
ensure => present,
key_type => 'dsa',
}
# /etc/puppet/modules/<module_name>lib/puppet/type/ssh_keypair.rb
Puppet::Type.newtype(:ssh_keypair) do
newparam(:name, :namevar => true) do
89 -> body = Controller.prepare_request_body(request.context, body, True,
390 self._resource, self._attr_info,
391 allow_bulk=self._allow_bulk)
'port_security_enabled': {'allow_post': True,
'allow_put': True,
'convert_to': <function convert_to_boolean at 0x7f1a20433938>,
'default': <object object at 0x7f1a2476b350>,
'enforce_policy': True,
'is_visible': True},
-> project_id = str(uuid.UUID(port_q['tenant_id']))
(Pdb) pp port_q
{'admin_state_up': True,
'binding:host_id': None,
'binding:profile': None,
'binding:vnic_type': 'normal',
'device_id': u'',
'device_owner': u'',
'fixed_ips': None,
'mac_address': None,
"permissions": {
"group": "admin",
"group_access": 7,
"other_access": 7,
"owner": "cloud-admin",
"owner_access": 7
{
"fq_name": [
"default-domain",
"testtenant",
"default"
],
"href": "http://127.0.0.1:9100/security-group/81c71ab1-4433-4d9f-8929-71b9912a9587",
"uuid": "81c71ab1-4433-4d9f-8929-71b9912a9587"
}
root@ct1-testdan-060515222150:~# dpkg -l *contrail*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================-==============-==============-===========================================
un contrail-api-lib <none> <none> (no description available)
ii contrail-config 1.21+3201+0935 all OpenContrail configuration management
ii contrail-config-ope 1.21+3201+0935 all OpenContrail configuration OpenStack module
ii contrail-control 1.21+3201+0935 amd64 OpenContrail control-node
(/Stage[main]/Glance::Keystone::Auth/Keystone::Resource::Service_identity[glance]/Keystone_service[glance]/description) change from Openstack Image Service to OpenStack Image Service failed: Updating the service is not currently supported.