Provide custom userdata extension for each of services if it needed

Registered by Denis M. on 2013-10-03

Suppose we have to deploy specific database that doesn't
pulls it's own dependencies (probably more than one).
And those dependencies are stored in custom repository (rhel/ppa).

------------------------------------------------------------------------------------
I'm offering next solution:

Let trove store custom additional parameters for cloud-init script as an extensions.
This would let trove-guestagent become a bit simpler
and do not let guestagent perform deployment
more than one package (directly related to specific database).

Although, with this kind of workflow trove could keep only one cloud-init script.
And according to service pre-setup.py, default cloud-init would be
extended when it would be transformed into userdata.

------------------------------------------------------------------------------------

Mechanism would be like this:

trove/extension/service/custom_database/pre_setup.py:
(where custom_database is mysql/percona/redis/cassandra/mongo)

it would store next fields (custom for each database)

java = {'oracle': 'oracle-7-jdk', 'open-jdk': 'open-jdk7'}
ppa = {'deb': ..., 'dep_source': ...}
rhel = {'repository': ..., 'parameters': {...}}
command_list = ['gpg --keyserver pgp.mit.edu --recv-keys 4BD736A82B5C1B00\n',
'gpg --export --armor F758CE318D77295D | sudo opt-key add -\n',
'echo -e "2" | sudo update-alternatives --config java\n']

* command_list contains list of command that would be appended to userdata

------------------------------------------------------------------------------------

In cloud-init processing:

cloudinit = os.path.join(CONF.get('cloudinit_location'), "*.cloudinit")
if os.path.isfile(cloudinit):
with open(cloudinit, "r") as f:
userdata = f.read()
pre_setup = utils.import_module('trove.extensions.service.%s.pre_setup' %
self.service_type)
if hasattr(pre_setup, 'command_list'):
userdata.join(pre_setup.command_list)

------------------------------------------------------------------------------------
Although it should be integrated into trove-heat support

Blueprint information

Status:
Complete
Approver:
None
Priority:
Not
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
Accepted for future
Implementation:
Started
Milestone target:
milestone icon ongoing
Started by
Denis M. on 2013-10-03
Completed by
Amrith Kumar on 2016-10-12

Related branches

Sprints

Whiteboard

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.