/cfme-rhconsulting-scripts

Primary LanguageRubyGNU General Public License v2.0GPL-2.0

Cloudforms/ManageIQ rhconsulting rake scripts

These scripts are useful to import/export specific items

Note: be sure that there are no other tasks in lib/tasks with the same task name. Rake ignores the namespace (rhconsulting in this case) and uses the task method name. This can cause issues if you have two rake files with the same task names. For example, make sure there are not two instances of the dialogs:export. Even if you specify the namespace rake might choose the wrong task to run

Install

Option 1) use make commands

  • Get latest files from github

rm -fR cfme-rhconsulting-scripts/
git clone https://github.com/rhtconsulting/cfme-rhconsulting-scripts.git
  • Install files to /var/www/miq/vmdb/lib/tasks

cd cfme-rhconsulting-scripts/
make install
  • Clean install (Removes the files before installing)

cd cfme-rhconsulting-scripts/
make clean-install

Option 2) Copy files manually * Copy the .rake files to /var/www/miq/vmdb/lib/tasks

cd cfme-rhconsulting-scripts/
cp *.rake /var/www/miq/vmdb/lib/tasks/

Export command

Usage: miqexport <object_type> <additional_params> <exportdest>

This command exports the specified object type into the <exportdest>,
which may be a file or directory.

<additional_params> may be required depending on the type of object to be
exported.

Available Object Types:
  dialogs                          Export service dialogs.
  service_catalogs                 Export service catalogs.
  roles                            Export user roles.
  tags                             Export tags.
  buttons                          Export buttons.
  customization_templates          Export customization templates.
  reports                          Export custom reports.
  policies                         Export policies.
  domain <name>                    Export the specified domain from the
                                   Automate Engine Datastore. <name> MUST
                                   be specified.

Example exports

# export the 'MyCustomDomain' to /tmp, i.e., /tmp/MyCustomDomain
miqexport domain MyCustomDomain /tmp

# export dialogs to /tmp/dialogs
miqexport dialogs /tmp/dialogs

Import Command

Usage: miqimport <object_type> <additional_params> <importsource>

This command imports the specified object type from the <importsource>,
which may be a file or directory.

<additional_params> may be required depending on the type of object to be
imported.

Available Object Types:
  dialogs                          Import service dialogs.
  service_catalogs                 Import service catalogs.
  roles                            Import user roles.
  tags                             Import tags.
  buttons                          Import buttons.
  customization_templates          Import customization templates.
  reports                          Import custom reports.
  policies                         Import policies.
  domain <name>                    Import the specified domain from the
                                   <importsource> directory. <name> MUST
                                   be specified.

Example Imports

# import 'MyCustomDomain' from /tmp, i.e., /tmp/MyCustomDomain
miqimport domain MyCustomDomain /tmp

# import dialogs from /tmp/dialogs
miqimport dialogs /tmp/dialogs

Export examples using rake

BUILDDIR=/tmp/CFME-build
DOMAIN_EXPORT=YourDomainHere

rm -fR ${BUILDDIR}
mkdir -p ${BUILDDIR}/{service_catalogs,dialogs,roles,tags,buttons,customization_templates,policies,miq_ae_datastore}

cd /var/www/miq/vmdb
bin/rake rhconsulting:dialogs:export[${BUILDDIR}/dialogs]
bin/rake rhconsulting:service_catalogs:export[${BUILDDIR}/service_catalogs]
bin/rake rhconsulting:roles:export[${BUILDDIR}/roles/roles.yml]
bin/rake rhconsulting:tags:export[${BUILDDIR}/tags/tags.yml]
bin/rake rhconsulting:buttons:export[${BUILDDIR}/buttons/buttons.yml]
bin/rake rhconsulting:customization_templates:export[${BUILDDIR}/customization_templates/customization_templates.yml]
bin/rake rhconsulting:miq_policies:export[${BUILDDIR}/policies]
bin/rake "rhconsulting:miq_ae_datastore:export[${DOMAIN_EXPORT}, ${BUILDDIR}/miq_ae_datastore]"

Import examples using rake

BUILDDIR=/tmp/CFME-build
DOMAIN_IMPORT=YourDomainHere

cd /var/www/miq/vmdb
bin/rake rhconsulting:dialogs:import[${BUILDDIR}/dialogs]
bin/rake rhconsulting:service_catalogs:import[${BUILDDIR}/service_catalogs]
bin/rake rhconsulting:roles:import[${BUILDDIR}/roles/roles.yml]
bin/rake rhconsulting:tags:import[${BUILDDIR}/tags/tags.yml]
bin/rake rhconsulting:buttons:import[${BUILDDIR}/buttons/buttons.yml]
bin/rake rhconsulting:customization_templates:import[${BUILDDIR}/customization_templates/customization_templates.yml]
bin/rake rhconsulting:miq_policies:import[${BUILDDIR}/policies]
bin/rake "rhconsulting:miq_ae_datastore:import[${DOMAIN_IMPORT}, ${BUILDDIR}/miq_ae_datastore]"

Contribution guidelines

  • Writing tests

  • Code review

  • Other guidelines

Who do I talk to?