Separazione del playbook deploy (obbligatorio) e addizionali.
This commit is contained in:
parent
7a81d01461
commit
b865b23baf
@ -75,12 +75,18 @@ inventory = command.local.Command("a-inventory",
|
||||
opts = pulumi.ResourceOptions(depends_on = [ wait_time ])
|
||||
)
|
||||
|
||||
# Applying the command
|
||||
for playbook in config.get('playbooks').split(','):
|
||||
execute_ansible = command.local.Command(f"a-{playbook.split('.')[0]}",
|
||||
create = f"ansible-playbook {playbook}",
|
||||
delete = "rm -f ./ansible.log",
|
||||
deploy = command.local.Command('ap deploy',
|
||||
create = 'ansible-playbook deploy.yml',
|
||||
delete = 'rm -f ./ansible.log',
|
||||
opts = pulumi.ResourceOptions(depends_on = [ inventory ])
|
||||
)
|
||||
|
||||
# Running additional playbooks
|
||||
for playbook in sorted(config.get('playbooks').split(',')):
|
||||
execute_ansible = command.local.Command(f"ap {playbook.split('.')[0]}",
|
||||
create = f"ansible-playbook {playbook}",
|
||||
delete = "rm -f ./ansible.log",
|
||||
opts = pulumi.ResourceOptions(depends_on = [ deploy ])
|
||||
)
|
||||
|
||||
pulumi.export("ip", vm.network_interfaces[0]['addresses'][0])
|
||||
|
Loading…
Reference in New Issue
Block a user