Mike,
So the roles directory is something I created manually. I saw this on a
video tutorial directly made from Ansible and the instructor was creating
these manually and then initiating the roles from within the roles
directly. I applied the same concept and it worked :). I'll def. check out
I'm actually surprised that this tree worked; I would have expected 'roles'
to need to be under powerbroker_install (i.e.
powerbroker/powerbroker_install/roles/pb_install_dev, etc), but glad that
things are working for you.
For passwords, are you familiar with prompts
Mike,
Thanks for your patience and assistance. I wanted to do it the way you
suggested so that I get in the habit of crafting my roles that can be
useful in other ways later. With that said, I think I am getting the hang
of what you are saying. I started completely over and separated my roles.
like I said, since you've put this into a role, "separating this into
multiple plays would be more complicated", so you're better off not
splitting it up and instead, doing what you were doing
copied from your earlier post (with the typo pointed out by Uditha
corrected:
In
Hi Mike,
Thanks for the suggestions. I tried to implement what you mentioned and I
ended up breaking everything. I am completely lost with this. I am just
going to have to start over at this point. Between sanitizing the data to
post here and then trying to translate your suggestions back to
1. what Uditha said about 'testservers'.
2. By "use multiple plays", I meant to create one play that specifies hosts:
testservers, another play that specifies hosts: dev-servers, and a third
that specifies hosts: prod-servers.
Then, have specific tasks for those servers.
Now, re-looking at
Mike,
I got a bit further with your suggestion. I changed my tree to look like
the one you have and now it looks like it's trying to kick. However, now
it's not finding the value of my *hosts: *"{{ test }}"
When I run the command, I see this now:
[WARNING]: provided hosts list is empty, only
Ok, if I change my vars main.yml
From
---
# vars file for app_install
test: "{{ testservers }}"
To
---
# vars file for app_install
test: "testservers"
...I get the following:
Sudo password:
PLAY [install app and join appropriate ou] **
TASK [setup]
Or ... your problem could be that you don't have a group defined as
"testservers". Only "testsystems".
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I can't put this up on github. I had to sanitize it a lot just to get it
here too :/.
If the structure is wrong, then I am not sure what should be changed. I got
that structure initially by running *ansible-galaxy init role_name* and
have modified the structure here and there based on
Hi Arthur, can you elaborate on exporting ANSIBLE_INVENTORY? All I did was
call my inventory file like this: *ansible-playbook -i server_hosts
app_install_main.yml*
Thanks for the quick response :)
On Thursday, March 17, 2016 at 8:26:17 PM UTC-4, Arthur Reyes wrote:
>
> Just a thought. Did you
Mike,
And then in my app_install_main.yml, I have the following:
---
- name: install app and join systems to domain
hosts: "{{ test }}"
become: yes
roles:
- app_install
vars_prompt:
- name: "ansible_sudo_pass"
prompt: "Sudo password"
private: yes
--
You received this
Is there any way to put this up as e.g. a github repo?
I'm pretty sure your layout is wrong but it's hard to keep track of
what's where without having it to hand.
On 18 March 2016 at 19:01, Gilberto Valentin wrote:
> Mike,
>
> I got a bit further with your suggestion. I
Hi Arthur,
Actually, I do have my app_install as a sub directory under roles. It's
just that initially I only pasted everything within roles and only showing
you that. Here's a better view:
~/git/ansible/roles$ tree
.
└── project1
├── server_hosts
├── app_install
│ ├── README.md
It looks like your directory structure isn't quite right. app_install should be
a sub directory under roles, which might explain why your playbook never finds
vars/main.yml.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe
Unless I've missed something, I can't see where your top-level
"app_install_main.yml" play is expecting to get "test" from -- it needs to
know the list of hosts to work with before it starts opening up the roles,
and it doesn't import those variables from anywhere itself?
As far as I know, a
Mike and Uditha,
Ok, I see what you guys are saying about the hosts. I moved it one level up
and now we are getting somewhere. Now, the issue is that it can't run my
task because it doesn't see the value of my conditional. For example, I
want my task to run *when: "{{ testserver }}"*. In other
Overall, you are better off customizing your plays for each group (maybe in
separate playbooks) instead of trying to make a one-size-fits-all playbook.
Tasks can be reused by either importing them or putting them in roles.
The other nice thing about this model is that when you run
That "when" should be checking for "testservers" (plural).
On Fri, 18 Mar 2016, 23:59 Gilberto Valentin, wrote:
> Hi Mike,
>
> When I say "moved it up one level", I meant I took my hosts file out of
> the roles directory and moved it up one level out of there.
>
> Now,
I think your tree should look more like this. Also notice the change of
tasks/app_install_task.yml to tasks/main.yml
~/git/ansible$ tree
.
└── project1
├── server_hosts
├── roles
│ └── app_install
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│
I agree with Mike's suggestion regarding changing that conditional to when:
"'testservers' in group_names" -- that's exactly how I handle special cases
like DMZ hosts.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from
Hi Mike,
When I say "moved it up one level", I meant I took my hosts file out of the
roles directory and moved it up one level out of there.
Now, back to your suggestions. For your first point, I am not sure I
follow. For example, you said to run my play (I understand this as task)
with
22 matches
Mail list logo