Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use against groups of appliances #2

Open
hstenzel opened this issue Jan 12, 2015 · 0 comments
Open

Use against groups of appliances #2

hstenzel opened this issue Jan 12, 2015 · 0 comments

Comments

@hstenzel
Copy link

Q: have you ever considered adding the ability to create appliance groups? I almost never do things to a single appliance. I generally want to make the exact same change to a group of appliances. The end result is that every script I have ends up with a top level loop to iterate through the appliances.

A:
As for the loop, can you describe more about how it should work? I've thought about it, but never come up with an approach I liked better than multiple calls to init. For instance, do we want to join tables? how? How does import work? etc. Should it be for every command (specified on init), or for each command (flags on each command, ewww).
To do what you describe, you could do a little shell function, something like this:
function dploop ()
{
shift
local dp=""
for dp in $DPS
do
echo "=== $dp ==="
dpxmlsh_init -h $dp
"$@"
done
}

then you can do something like:
DPS="dp1 dp2 dp3"
dploop dpxmlsh_get_status_list Version
and you should get all the version for each.

Follow-up Q:
Perhaps you could do a different type of init, maybe dpxmlsh_group_init where you specify multiple hosts? Then each command issued after that init and before the next would be executed to each. The more I think about it, it actually sounds kinda clunky. Maybe its best I just implement a cleaner looping method.

Follow-up A:
We can think about how looping might work. Some good examples are dsh and pssh might be reasonable models, I think you're coming to the same conclusion as I that it might be a little clunky.

Link:
https://www.ibm.com/developerworks/community/forums/html/topic?id=567faa76-38df-4e41-965f-6e5dac275154#78adf768-4dc3-4858-aa62-8325a0df6542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant