openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

A service has been created without defining it in the blueprint #23

Closed john-kheir closed 6 years ago

john-kheir commented 6 years ago

Scenario

1- Create a blueprint to create acc1 and vdc1

services:
    - github.com/openvcloud/0-templates/sshkey/0.0.1__key2:
        path: '/root/.ssh/id_rsa'
    - github.com/openvcloud/0-templates/openvcloud/0.0.1__be-g8-4:
        address: 'be-g8-4.demo.greenitglobe.com'
        login: 'kheirj@itsyouonline'
        token: '***'
    - github.com/openvcloud/0-templates/vdcuser/0.0.1__kheirj:
        provider: itsyouonline
        email: kheirj@greenitglobe.com
    - github.com/openvcloud/0-templates/vdcuser/0.0.1__bisho:
        provider: itsyouonline
        email: abdelmab@greenitglobe.com
    - github.com/openvcloud/0-templates/account/0.0.1__acc1:
        users:
             - accesstype: CXDRAU
               name: kheirj

    - github.com/openvcloud/0-templates/vdc/0.0.1__azmyvdci3:
        location: be-g8-4
        users:
             - name: bisho
               accesstype: CXDRAU
             # - name: kheirj
             #  accesstype: CXDRAU

actions:
    - template: github.com/openvcloud/0-templates/account/0.0.1
      actions: ['install']

    - template: github.com/openvcloud/0-templates/vdcuser/0.0.1
      actions: ['install']

    - template: github.com/openvcloud/0-templates/vdc/0.0.1
      actions: ['install']

2- Change actions to uninstall and run the bp again, acc1 and vdc1 should be uninstalled 3- Change the account name to acc2 and specify a "service=acc2" in actions section under account , and run the blueprint.

Actual Result

acc1 will be created again while it shouldn't be created.

chrisvdg commented 6 years ago

@john-kheir, I think the service acc1 is still running, uninstalling doesn't stop the service from running. So if you run the following for the second install bp

...
    - template: github.com/openvcloud/0-templates/account/0.0.1
      actions: ['install']
...

It will run install for both __acc1 and __acc2

If you only want to invoke install on acc2 you should specify the service name in the actions:

...
    - template: github.com/openvcloud/0-templates/account/0.0.1
      service: acc2
      actions: ['install']
...

Edit: realized this is what you did on the second install bp from your description.

chrisvdg commented 6 years ago

@john-kheir, I was not able to reproduce it Can you try again with current code?

john-kheir commented 6 years ago

doesn't happen anymore