I am trying to loop over a task using “with_sequence” and I need to make it work such that it run one specific line only once but rest of the lines it executes as normal times.
It not succeeding or I am not able to figure out how to do it.
Please advise
I need to create multiple volumes of different sizes
example:
10 Volumes of 50GB
50 Volumes of 500GB
100 Volumes of 5000GB
I usually get such requests so, I thought of creating one playbook which could give me following result:
Create Volume on hp3par storage box
Map this newly created volume to the existing host entry in hp3par storage.
And thats why I thought of looping over volume creation task, same number of times the requester requested to create same size volume. like a loop of 10 times for 50GB volume. And I created some vars_prompt to ask for like:
host names
volume size
number of volumes to create etc
The volume creation task module & its parameters are as follows:
This loop runs over all the parameter and hence prompt for size as same number of times the loop run even for the same size of volumes.
Whereas I want it to ask for size only for once and create this same size of volume 10 times or whatever requested times.
Hoping, I have explained it efficient manner this time
So, I do not want to leave that out rather just want to take the input only once and size being required parameter of the module, it will be asked every time the loop iterates.
I need to create multiple volumes of different sizes
example:
10 Volumes of 50GB
50 Volumes of 500GB
100 Volumes of 5000GB
I usually get such requests so, I thought of creating one playbook which
could give me following result:
1. Create Volume on hp3par storage box
2. Map this newly created volume to the existing host entry in hp3par
storage.
And thats why I thought of looping over volume creation task, same number
of times the requester requested to create same size volume. like a loop of
10 times for 50GB volume. And I created some vars_prompt to ask for like:
- host names
- volume size
- number of volumes to create etc
The volume creation task module & its parameters are as follows:
This loop runs over all the parameter and hence prompt for size as same
number of times the loop run even for the same size of volumes.
Whereas I want it to ask for size only for once and create this same size
of volume 10 times or whatever requested times.
Hoping, I have explained it efficient manner this time
It seams you have left out a lot of the code you are actually running so this it's impossible to understand what you are having trouble with.
So, I do not want to leave that out rather just want to take the input only
once and size being required parameter of the module, it will be asked
every time the loop iterates.
I'm not sure i understand the problem you have ref the above, but if you create an vars_promt with name size and one with name count then this task would work