Re: [ansible-project] Unexpected exception when including tasks from main.yml

2015-12-02 Thread Brian Coca
the assumption is correct, what is incorrect is your usage of 'tasks:'
in this file, the message can be made clearer though.


-- 
Brian Coca

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8krmMccgcr6VnO4%3DY1-KQVTiZFQj-qLDOjCv%2BcTrHBbDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Why use Ansible

2015-12-02 Thread Fabricio Cruz


Hello!

I'm  conducting a search  for Differences among other tools and ansible .
 Where can I find the advantages of using the ansible ? My question is :
Why use ansible , he is better than the puppet ?


Tks,

Fabricio

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/17a48540-be63-49fd-92ae-336f1411d7ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Escaping curly braces in a dictionary.

2015-12-02 Thread brian . lycett
Hi.  I'm struggling to escape double curly braces in a dictionary.  I've 
tried the {{ '{{' }} blah {{ '}}' }} method, tried using backslashes and 
also tried using {% raw %}{{blah}}{% endraw %}
I need to be able to do this as datadog uses curly braces in its alerts as 
macros.

Here's an example I'm using to debug:

vars/main.yml:

datadog_alerts:

  - name: "Testy test test McTest {{ '{{' }}host.name{{ '}}' }}"
query: 
"'testhost.status'.over('*').by('check','id').last(2).count_by_status()"
type: service check
message: 'Testy test test test test'


tasks/main.yml:

- name: List datadog monitors
  debug: "{{ item.type }} {{ item.name }} {{ item.query }}"
  with_items: datadog_alerts


Running that play (Ansible v2.1.0) results in:

TASK [datadog-alerts : List datadog monitors] 
**
fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! ERROR! 
'host' is undefined"}

as it's trying to interpolate host.name.

Does anyone have any ideas on how to get around this?

Regards,

Brian

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c80acb15-f933-4168-a555-b25262d65751%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unexpected exception when including tasks from main.yml

2015-12-02 Thread Brian Coca
So updated via c1add8c5e4758d2edea6e49c1b62aee614f5c4fb which now
captures the assertion error and gives out something a bit more
helpful.


-- 
Brian Coca

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kT2t%2BkYnB7-RMQVfeM%3Dcwvtopspp8QK2S-2RF5WBofZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unexpected exception when including tasks from main.yml

2015-12-02 Thread Yongzhi Pan
Ansible assumes that roles/x/tasks/main.yml is a plain list of tasks, but 
when the file is in the format:

tasks:
- xxx
...

it fails with unexpected exception (AssertionError):

File "/opt/ansible/ansible/lib/ansible/playbook/helpers.py", line 37, in 
load_list_of_blocks
assert isinstance(ds, (list, type(None)))
AssertionError

When it expects ds to be an list, it is actually an dict with 'task' key.

It involves digging into the Ansible code to know that my main.yml is 
malformed. I would suggest Ansible point out the syntax, or accept both 
format of main.yml.

In either case, I would like to send a patch for review.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0f1fc49d-ba87-4c33-b1e9-5020b7e21f77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unexpected exception when including tasks from main.yml

2015-12-02 Thread Matt Martz
Also, having the full traceback would be helpful.

All of those AssertionError exceptions should be caught, and the proper
AnsibleParserError should be raised instead.

The catching of AssertionError should be happening in all locations where
load_list_of_blocks, load_list_of_tasks and load_list_of_roles is being
used.

I was unable to find any place where the AssertionError is not being caught
in current devel.



On Wed, Dec 2, 2015 at 10:06 AM, Brian Coca  wrote:

> the assumption is correct, what is incorrect is your usage of 'tasks:'
> in this file, the message can be made clearer though.
>
>
> --
> Brian Coca
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAJ5XC8krmMccgcr6VnO4%3DY1-KQVTiZFQj-qLDOjCv%2BcTrHBbDA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-MOvMqoTzC9BT1SsFXHJ42QXLYQf9EbeVs9Lyv4uj2nA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] chown recursively with file module is very slow

2015-12-02 Thread Thomas Steinbach
Hi, I want to ensure that a directory and all its children belongs to a 
user/group. Normally I would do following with Ansible:

file:
 dest: /path/to/dir
 owner: userx
 group: groupx
 recurse: yes 


However this approach takes in my case about 10 minutes or more, because 
the folder contains recursively hundreds of subfolders and thousands of 
files. With the following approach this task takes me just seconds:

command: "chown -R userx:groupx /path/to/dir"
changed_when: false


Why is the Ansible native approach so much slower? Is it because it checks 
the state before/after the (possible) change? Or is there a faster good 
practice approach with Ansible?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f1aa9715-4ccc-4db4-b706-b83d9803d601%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Why use Ansible

2015-12-02 Thread Thomas Steinbach
Depending on how sophisticated your answer should be, i advice you 
following great book: 
https://valdhaus.co/books/taste-test-puppet-chef-salt-stack-ansible.html

What I like on Ansible compared to Puppet is:


   - no hassle with installing a client or agent on the remote machines. so 
   a playbook normally works out of the box for new clients
   - really easy to read provisioning scripts in YAML
   - far more easy to learn
   - far better and growing Docker support (you can directly deploy 
   configurations into a container)
   - last but not least - a very responsive community

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55a8fa3d-e927-4cd5-b751-9ac32a652065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Get IP Address of server

2015-12-02 Thread saikrishnakhanday
Can any one please help me how can I write a script to fetch its own IP 
Address.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9f6320cc-19b6-4391-986a-57bdc0b78629%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] chown recursively with file module is very slow

2015-12-02 Thread Brian Coca
that is exactly it, ansible checks each and every file/dir in the
tree, 'chown -R ' does not, it just sets it.

-- 
Brian Coca

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8k11See8inxMXKs30FuKugEEz%3D%3DKxzr%3Dyyoi0e61yqVrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Get IP Address of server

2015-12-02 Thread saikrishnakhanday
ListenIP={'macaddress': '00:50:56:9e:76:33', 'network': '10.53.153.0', 
'mtu': 1500, 'alias': 'eth0', 'netmask': '255.255.255.0', 'address': 
'10.53.153.33', 'interface': 'eth0', 'type': 'ether', 'gateway': 
'10.53.153.1'}

above was the output, think its working but I just want only the Ip addr

Thanks!

On Wednesday, December 2, 2015 at 11:12:03 AM UTC-6, saikrish...@gmail.com 
wrote:
>
> Can any one please help me how can I write a script to fetch its own IP 
> Address.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/433bd277-f886-42b7-96da-d2efcd07bbf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] # of ssh connections / timeout function?

2015-12-02 Thread richard kappler
This is a two part question. I sort of worked around the problem I asked 
about yesterday (third task crashes on third of 4 machines) by splitting up 
my playbook into 3 parts. Ugly, but for now it works, at least on four 
machines at a time, testing bigger inventory now.

*Possibly pertinent information:* We deploy into a closed network (behind a 
vpn) which is composed of over 500 vm's on hardware spread across the US. 
The ssh connection to these machines is SLOW due to a config problem that I 
am not, at the moment, allowed to correct. As such, it ca take as long a 
two + minutes from when I request an ssh connection to when it actually 
establishes. Again, I know what the issue is and how to fix it, but am not 
allowed to at the moment. 

*What I've noticed:* as ansible moves through the playbook, it moves up and 
down the inventory list. In other words, it will start task one on machine 
one (of 5 let's say) and move sequentially (seemingly in pairs) through to 
machine 5, then the next task starts on machine 5 and moves up the list 
from 4 to 3 to 2 to 1. I've notice that each task executes quickly on the 
first two machines in a task, and that they were the last two machines in 
the previous task. I've also noted that each task is executed quite quickly 
on a consecutive pair of machines (regardless of geographic location btw) 
but then there is a lonnng delay between the same task executing on the 
next pair. 

*Questions: *This leads me to wonder: is there a timeout occurring in 
ansible? Does it actually open ssh tunnels in pairs?

I can't fix the built in delay in the vm's right now, so am hoping to make 
changes in ansible until this can be fixed in the hosts, but right now my 
suspicions that the process is timing out due to long delay between the 
starting pair of one task until they are the end pair of the next task is 
causing some sort of time out issue.

Then again my theory could be hooey and we're just cursed. :-(

regards, Richard

ps: while I wrote the above I was running a playbook that makes a directory 
and moves and untars a 14.5 MB file using unarchive. This worked fine on a 
4 machine inventory. It crashed on the unarchive task after the third 
machine. 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e0640ea3-d3a1-4c3c-bfc0-dae3d163ec7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Get IP Address of server

2015-12-02 Thread Jean-Yves LENHOF
Something like this ? (not tested)

action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf" backup=yes
state=present regexp="^ListenIP=0.0.0.0" line="ListenIP={{
ansible_default_ipv4 }}"

Regards,


Le 02/12/2015 21:20, saikrishnakhan...@gmail.com a écrit :
> Hi Jean
>
>  tasks:
>   - name: set hostname
> action: hostname name=devcfgl02
>
>   - name: create zabbix group
> action: group name=zabbix gid=1100
>
>   - name: create zabbix user
> action: user name=zabbix uid=1100 group=zabbix comment="Zabbix
> Monitoring User" home="/home/zabbix"
>
>   - name: add zabbix restart with yum
> yum:
> name=http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
> state=present
>
>   - name: Ensure that zabbix is installed
> yum: pkg=zabbix-agent state=installed
>
>   - name: Ensure that zabbix is running
> service: name=zabbix-agent state=started enabled=yes
>
>   - name: zabbix-server restarted
> service: name=zabbix-agent state=restarted enabled=yes
>
>   - name: change zabbix_agent.conf server
> action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf"
> backup=yes state=present regexp="Server=127.0.0.1"
> line="Server=prdmonapp1"
>
>   - name: change zabbix_agent.conf server
> action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf"
> backup=yes state=present regexp="ServerActive=127.0.0.1"
> line="ServerActive=prdmonapp1:10045"
>
>   - name: change zabbix_agent.conf server
> action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf"
> backup=yes state=present regexp="ListenIP=0.0.0.0"
>
> What action do i have to use here in the last step to fetch its own
> server ip and replace the ListenIP in the config file.
>
>
> On Wednesday, December 2, 2015 at 11:12:03 AM UTC-6,
> saikrish...@gmail.com wrote:
>
> Can any one please help me how can I write a script to fetch its
> own IP Address.
>
> -- 
> 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 ansible-project+unsubscr...@googlegroups.com
> .
> To post to this group, send email to ansible-project@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/31a72b53-cc29-4395-b614-834656c46f90%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/565F53C0.4060604%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible-playbook hangs during execution

2015-12-02 Thread Guy Knights
Just an update, I used this method and was able to isolate the host that 
was causing the issue. It turned out to be an issue with my AWS VPC setup 
where the host didn't have a path to the internet and apt was hanging while 
trying to install packages.

On Monday, November 30, 2015 at 10:10:44 AM UTC-8, Guy Knights wrote:
>
> Sounds like a solid plan, I'll give it a go. Thanks!
>
> On Fri, Nov 27, 2015 at 11:01 PM, J Hawkesworth <
> j.r.hawkeswo...@googlemail.com> wrote:
>
>> Perhaps using -l to limit the playbook run to one host at a time would at 
>> least help you isolate the problem? I think -l takes group names and 
>> patterns if you have lots of hosts.
>>
>> -v might give you a clue what is going on too.
>>
>> --
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/78KLq9b9pCc/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> ansible-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/e8c31e5b-293b-42f5-9592-bf36afab5967%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f9789a0d-670a-424c-bc30-50d7db75446f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Get IP Address of server

2015-12-02 Thread Jean-Yves LENHOF
Why do you want to write a script ?
There's sure a fact for this...

Look at :
ansible_default_ipv4
ansible_default_ipv6

Regards,

Le 02/12/2015 17:37, saikrishnakhan...@gmail.com a écrit :
> Can any one please help me how can I write a script to fetch its own
> IP Address.
> -- 
> 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 ansible-project+unsubscr...@googlegroups.com
> .
> To post to this group, send email to ansible-project@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9f6320cc-19b6-4391-986a-57bdc0b78629%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/565F44A4.20006%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Get IP Address of server

2015-12-02 Thread saikrishnakhanday
Hi Jean

 tasks:
  - name: set hostname
action: hostname name=devcfgl02

  - name: create zabbix group
action: group name=zabbix gid=1100

  - name: create zabbix user
action: user name=zabbix uid=1100 group=zabbix comment="Zabbix 
Monitoring User" home="/home/zabbix"

  - name: add zabbix restart with yum
yum: 
name=http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
 
state=present

  - name: Ensure that zabbix is installed
yum: pkg=zabbix-agent state=installed

  - name: Ensure that zabbix is running
service: name=zabbix-agent state=started enabled=yes

  - name: zabbix-server restarted
service: name=zabbix-agent state=restarted enabled=yes

  - name: change zabbix_agent.conf server
action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf" backup=yes 
state=present regexp="Server=127.0.0.1" line="Server=prdmonapp1"

  - name: change zabbix_agent.conf server
action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf" backup=yes 
state=present regexp="ServerActive=127.0.0.1" 
line="ServerActive=prdmonapp1:10045"

  - name: change zabbix_agent.conf server
action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf" backup=yes 
state=present regexp="ListenIP=0.0.0.0"

What action do i have to use here in the last step to fetch its own server 
ip and replace the ListenIP in the config file.


On Wednesday, December 2, 2015 at 11:12:03 AM UTC-6, saikrish...@gmail.com 
wrote:
>
> Can any one please help me how can I write a script to fetch its own IP 
> Address.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/31a72b53-cc29-4395-b614-834656c46f90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Get IP Address of server

2015-12-02 Thread saikrishnakhanday

action: lineinfile dest="/etc/zabbix/zabbix_agentd.conf" backup=yes 
state=present regexp="^ListenIP=0.0.0.0" line="ListenIP={{ 
ansible_default_ipv4.address }}"

added .address and it is working the way I was expecting. Appreciate your 
idea !

Cheers !
On Wednesday, December 2, 2015 at 11:12:03 AM UTC-6, saikrish...@gmail.com 
wrote:
>
> Can any one please help me how can I write a script to fetch its own IP 
> Address.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2a09f5ac-a39f-4f6e-b0cf-6afd1912ec00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Raw module and interactive commands

2015-12-02 Thread theyuseus
Extreme Networks' EXOS.  It's Linux based but doesn't have Python or other 
languages except one that I can't remember it's heritage (TCL maybe?).  I 
think the prompt is a heavily modified BusyBox or something.

I'm not sure how I would go about testing those 2 modules.  I could try 
them if you think they might work.  I can use the raw module to send 
commands and get back results, I just can't find any way around some of the 
interactive prompts.

I believe Extreme is working on adding Ansible support to their OS, but my 
switches won't can't be upgraded to any newer versions so I can't get those 
updates.


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2ec50404-c7fc-4974-98e2-68d6c2dfcc5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unable to create /etc/ansible/facts.d/openshift.fact, permission denied

2015-12-02 Thread Suryaveer Chauhan
Thanks for the reply.

How can I check which user is logging into the remote?

Below are the config parameters which has user details:
*Ansible vars:*

[OSEv3:vars]
*ansible_ssh_user=centos*
*ansible_sudo=true*

*Ansible.cfg*

[defaults]
hostfile = ansible_hosts
*remote_user = centos*
host_key_checking = False

Is it something different from this? Sorry, this is first time I am using 
ansible.

I can ssh into the target system as "*ssh centos@192.168.144.132*" and I 
can then create files in /etc/ansible folders.

Meanwhile, I added sudo =yes and sudo_user = centos in the .cfg and 
installation went ahead but now new error. Below is the log:

TASK: [openshift_facts | Gather Cluster facts] 
 
changed: [192.168.144.132]

TASK: [openshift_facts ] 
** 
changed: [192.168.144.132] => (item={'local_facts': {'public_ip': 
u'192.168.144.132', 'ip': u'10.0.1.163', 'public_hostname': u'master', 
'hostname': u'', 'deployment_type': u'{# deployment_type #}'}, 'role': 
'common'})
changed: [192.168.144.132] => (item={'local_facts': {'console_url': u'', 
'api_url': u'', 'cluster_public_hostname': u'', 'public_api_url': u'', 
'public_console_url': u'', 'api_use_ssl': u'', 'api_port': u'', 
'console_port': u'', 'console_path': u'', 'cluster_hostname': u'', 
'console_use_ssl': u''}, 'role': 'master'})

TASK: [Check status of external etcd certificatees] 
*** 
ok: [192.168.144.132] => (item=master.etcd-client.crt)
ok: [192.168.144.132] => (item=master.etcd-ca.crt)

TASK: [set_fact ] 
* 
skipping: [192.168.144.132]

PLAY [Create temp directory for syncing certs] 
 

TASK: [Create local temp directory for syncing certs] 
* 
ok: [localhost -> 127.0.0.1]

PLAY [Configure etcd certificates] 
 
skipping: no hosts matched

PLAY [Copy the external etcd certs to the masters] 
 

GATHERING FACTS 
*** 
ok: [192.168.144.132]

TASK: [Ensure certificate directory exists] 
*** 
skipping: [192.168.144.132]

TASK: [Unarchive the tarball on the master] 
*** 
skipping: [192.168.144.132]

TASK: [file ] 
* 
skipping: [192.168.144.132] => (item=master.etcd-client.crt)
skipping: [192.168.144.132] => (item=master.etcd-client.key)
skipping: [192.168.144.132] => (item=master.etcd-ca.crt)

PLAY [Determine if master certificates need to be generated] 
** 

GATHERING FACTS 
*** 
ok: [192.168.144.132]

TASK: [set_fact ] 
* 
ok: [192.168.144.132]

TASK: [set_fact ] 
* 
ok: [192.168.144.132]

TASK: [Check status of master certificates] 
*** 
ok: [192.168.144.132] => (item=admin.crt)
ok: [192.168.144.132] => (item=master.kubelet-client.crt)
ok: [192.168.144.132] => (item=master.proxy-client.crt)
ok: [192.168.144.132] => (item=master.server.crt)
ok: [192.168.144.132] => (item=openshift-master.crt)
ok: [192.168.144.132] => (item=openshift-registry.crt)
ok: [192.168.144.132] => (item=openshift-router.crt)
ok: [192.168.144.132] => (item=etcd.server.crt)

TASK: [set_fact ] 
* 
ok: [192.168.144.132]

PLAY [Configure master certificates] 
** 

GATHERING FACTS 
*** 
ok: [192.168.144.132]

TASK: [openshift_facts | Verify Ansible version is greater than 1.8.0 and 
not 1.9.0 and not 1.9.0.1] *** 
ok: [192.168.144.132]

TASK: [openshift_facts | Ensure PyYaml is installed] 
** 
ok: [192.168.144.132] => (item=PyYAML)

TASK: [openshift_facts | Gather Cluster facts] 
 
ok: [192.168.144.132]

TASK: [openshift_repos | assert ] 
* 
failed: [192.168.144.132] => {"assertion": 
"openshift.common.deployment_type in known_openshift_deployment_types", 
"evaluated_to": false, "failed": true}

FATAL: all hosts have already failed -- aborting

PLAY RECAP 
 
   to retry, use: --limit @/home/suryaveer/config.retry

192.168.144.132: ok=20   changed=2unreachable=0failed=1 
  
localhost  : ok=8changed=0unreachable=0failed=0 
  

Thanks a lot for your comment, at least, I moved further.

Regards,

On Wednesday, December 2, 2015 at 7:09:34 PM UTC-5, Andrew Edelstein wrote:
>
> It's not 

[ansible-project] Ansible createsuperuser with django_manage module.

2015-12-02 Thread anoop . kolari


Hi,

I'm creating a super user for my django application through ansible. Script 
is below.

django_manage: command="createsuperuser --noinput --username=admin --email=
anoop.kol...@tarams.com" app_path={{ django_dir }} 
settings={{settings_path}}

Its creating the super user with some random password. Please let me know 
the following at the earliest.


1) Is it possible to set password with the command?
2) Whats the default password its setting when executing that command?

-- 
 =
DISCLAIMER: The information in this message is confidential and may be 
legally privileged. It is intended solely for the addressee. Access to this 
message by anyone else is unauthorized. If you are not the intended 
recipient, any disclosure, copying, or distribution of the message, or any 
action or omission taken by you in reliance on it, is prohibited and may be 
unlawful. Please immediately contact the sender if you have received this 
message in error. Further, this e-mail may contain viruses and all 
reasonable precaution to minimize the risk arising there from is taken by 
Tarams. Tarams is not liable for any damage sustained by you as a result of 
any virus in this e-mail. All applicable virus checks should be carried out 
by you before opening this e-mail or any attachment thereto.
Thank you - Tarams Software Technologies Pvt.Ltd.
=

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/bcbd0d27-f686-4ff2-a88d-5c1cbd8aaef6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible openshift origin install fails for assertion openshift.common.deployment_type

2015-12-02 Thread Suryaveer Chauhan
Hi All,

I am trying to install OpenShift Origin V3 using ansible and it fails with 
following error:

TASK: [openshift_facts | Ensure PyYaml is installed] 
** 
ok: [192.168.144.132] => (item=PyYAML)

TASK: [openshift_facts | Gather Cluster facts] 
 
ok: [192.168.144.132]

TASK: [openshift_repos | assert ] 
* 
failed: [192.168.144.132] => {"assertion": 
"openshift.common.deployment_type in known_openshift_deployment_types", 
"evaluated_to": false, "failed": true}

FATAL: all hosts have already failed -- aborting

PLAY RECAP 
 
   to retry, use: --limit @/home/suryaveer/config.retry

192.168.144.132: ok=20   changed=2unreachable=0failed=1 
  
localhost  : ok=8changed=0unreachable=0failed=0 
  

*Below is my ansible host file:*

[OSEv3:children"]
masters
nodes
 
[OSEv3:vars]
ansible_ssh_user=centos
ansible_sudo=true
#ansible_ssh_user=root
 
product_type=openshift
*deployment_type=origin*
 
[masters]
192.168.144.132 openshift_public_hostname=master openshift_ip=10.0.1.163 
openshift_public_ip=192.168.144.132
 
[nodes]
192.168.144.128 openshift_public_hostname=node1 openshift_ip=10.0.1.164 
openshift_public_ip=192.168.144.128 openshift_node_labels="{'region': 
'primary', 'zone': 'east'}" 
192.168.144.129 openshift_public_hostname=node2 openshift_ip=10.0.1.165 
openshift_public_ip=192.168.144.129 openshift_node_labels="{'region': 
'primary', 'zone': 'west'}"

I found one post on github for similar error but was inconclusive.

Thanks

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9fbecfca-2eb2-4b2c-8d30-0842d3cc3352%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unable to create /etc/ansible/facts.d/openshift.fact, permission denied

2015-12-02 Thread Suryaveer Chauhan
I think I'll open a new question for better visibility.

On Thursday, December 3, 2015 at 12:41:07 AM UTC-5, Suryaveer Chauhan wrote:
>
> Thanks for the reply.
>
> How can I check which user is logging into the remote?
>
> Below are the config parameters which has user details:
> *Ansible vars:*
>
> [OSEv3:vars]
> *ansible_ssh_user=centos*
> *ansible_sudo=true*
>
> *Ansible.cfg*
>
> [defaults]
> hostfile = ansible_hosts
> *remote_user = centos*
> host_key_checking = False
>
> Is it something different from this? Sorry, this is first time I am using 
> ansible.
>
> I can ssh into the target system as "*ssh centos@192.168.144.132 
> *" and I can then create files in /etc/ansible 
> folders.
>
> Meanwhile, I added sudo =yes and sudo_user = centos in the .cfg and 
> installation went ahead but now new error. Below is the log:
>
> TASK: [openshift_facts | Gather Cluster facts] 
>  
> changed: [192.168.144.132]
>
> TASK: [openshift_facts ] 
> ** 
> changed: [192.168.144.132] => (item={'local_facts': {'public_ip': 
> u'192.168.144.132', 'ip': u'10.0.1.163', 'public_hostname': u'master', 
> 'hostname': u'', 'deployment_type': u'{# deployment_type #}'}, 'role': 
> 'common'})
> changed: [192.168.144.132] => (item={'local_facts': {'console_url': u'', 
> 'api_url': u'', 'cluster_public_hostname': u'', 'public_api_url': u'', 
> 'public_console_url': u'', 'api_use_ssl': u'', 'api_port': u'', 
> 'console_port': u'', 'console_path': u'', 'cluster_hostname': u'', 
> 'console_use_ssl': u''}, 'role': 'master'})
>
> TASK: [Check status of external etcd certificatees] 
> *** 
> ok: [192.168.144.132] => (item=master.etcd-client.crt)
> ok: [192.168.144.132] => (item=master.etcd-ca.crt)
>
> TASK: [set_fact ] 
> * 
> skipping: [192.168.144.132]
>
> PLAY [Create temp directory for syncing certs] 
>  
>
> TASK: [Create local temp directory for syncing certs] 
> * 
> ok: [localhost -> 127.0.0.1]
>
> PLAY [Configure etcd certificates] 
>  
> skipping: no hosts matched
>
> PLAY [Copy the external etcd certs to the masters] 
>  
>
> GATHERING FACTS 
> *** 
> ok: [192.168.144.132]
>
> TASK: [Ensure certificate directory exists] 
> *** 
> skipping: [192.168.144.132]
>
> TASK: [Unarchive the tarball on the master] 
> *** 
> skipping: [192.168.144.132]
>
> TASK: [file ] 
> * 
> skipping: [192.168.144.132] => (item=master.etcd-client.crt)
> skipping: [192.168.144.132] => (item=master.etcd-client.key)
> skipping: [192.168.144.132] => (item=master.etcd-ca.crt)
>
> PLAY [Determine if master certificates need to be generated] 
> ** 
>
> GATHERING FACTS 
> *** 
> ok: [192.168.144.132]
>
> TASK: [set_fact ] 
> * 
> ok: [192.168.144.132]
>
> TASK: [set_fact ] 
> * 
> ok: [192.168.144.132]
>
> TASK: [Check status of master certificates] 
> *** 
> ok: [192.168.144.132] => (item=admin.crt)
> ok: [192.168.144.132] => (item=master.kubelet-client.crt)
> ok: [192.168.144.132] => (item=master.proxy-client.crt)
> ok: [192.168.144.132] => (item=master.server.crt)
> ok: [192.168.144.132] => (item=openshift-master.crt)
> ok: [192.168.144.132] => (item=openshift-registry.crt)
> ok: [192.168.144.132] => (item=openshift-router.crt)
> ok: [192.168.144.132] => (item=etcd.server.crt)
>
> TASK: [set_fact ] 
> * 
> ok: [192.168.144.132]
>
> PLAY [Configure master certificates] 
> ** 
>
> GATHERING FACTS 
> *** 
> ok: [192.168.144.132]
>
> TASK: [openshift_facts | Verify Ansible version is greater than 1.8.0 and 
> not 1.9.0 and not 1.9.0.1] *** 
> ok: [192.168.144.132]
>
> TASK: [openshift_facts | Ensure PyYaml is installed] 
> ** 
> ok: [192.168.144.132] => (item=PyYAML)
>
> TASK: [openshift_facts | Gather Cluster facts] 
>  
> ok: [192.168.144.132]
>
> TASK: [openshift_repos | assert ] 
> * 
> failed: [192.168.144.132] => {"assertion": 
> "openshift.common.deployment_type in known_openshift_deployment_types", 
> "evaluated_to": false, "failed": true}
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP 
> 

Re: [ansible-project] Ansible Best Practice.

2015-12-02 Thread Andrew Edelstein
The short answer: it depends.

The long answer: How is your network / inventory is laid out? Where the
value of the variable will be unique for each server, or a single managed
machine is a one-off for that variable, you'd be best to store it in
host_vars/hostname, or perhaps in the inventory file  as "hostname
var=value". Where you have a group of machines in your inventory that will
all share the same value, create a group_vars/groupname file with that
variable. If you need to set a unique value for everything, when a role is
used in a specific play in a playbook, you can set the var as in a -vars
section within the play. It can also be done on the command line with
--extra-vars if it's a one-off that should be applied to every managed
machine that will be touched.

On Wed, Dec 2, 2015 at 3:19 PM, Jason Morgan 
wrote:

> I am currently developing a Playbook consisting of a number of roles via
> include statements as show below:
>
> hosts: testing
>sudo: yes
>roles:
>- timezone
>- ntp
>- mariadb
>- nfs-server
>
> I would appreciate some advice of where to put all the varables for the
> server eg Database , NFS exports, Timezone etc Would they be added as vars:
> in the main playbook ? As vars under a host_vars directory ?
>
> Thanks Jason
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3359062a-431a-44c7-b38a-dbc5e4621235%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BscPs6E6gL%2BdLqEshdERKmCuc26pj%3DvQ9Tm4-HOqL5bRt_rEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unable to create /etc/ansible/facts.d/openshift.fact, permission denied

2015-12-02 Thread Suryaveer Chauhan
Hi All,

I am a newbie to ansible.

I am following this blog 
 
to install OpenShift Origin V3 on OpenStack using ansible. But I am getting 
error as below:

* "Could not create fact file: %s, error: %s" % (filename, ex)*
* __main__.OpenShiftFactsFileWriteError: Could not create fact file: 
/etc/ansible/facts.d/openshift.fact, error: [Errno 13] Permission*
* denied: '/etc/ansible/facts.d'*

The target system is Centos and I can do passwordless sudo on the target 
systems. I even added in /etc/sudoers

 centos All=(ALL) NOPASSWD:ALL

to all the nodes and also on the system from which I am running ansible.

>From the system I run ansible, I tried executing as sudo, as root but same 
results.

I am not sure where it faces permission denied, I mean on the host or the 
target systems.

*Ansible vars:*

[OSEv3:vars]
ansible_ssh_user=centos
ansible_sudo=true

*Ansible.cfg*

[defaults]
hostfile = ansible_hosts
remote_user = centos
host_key_checking = False

Below is the full log:

root@ubuntu:/home/suryaveer# ansible all -m ping
192.168.144.129 | success >> {
"changed": false, 
"ping": "pong"
}

192.168.144.128 | success >> {
"changed": false, 
"ping": "pong"
}

192.168.144.132 | success >> {
"changed": false, 
"ping": "pong"
}

root@ubuntu:/home/suryaveer# ansible-playbook 
openshift-ansible/playbooks/byo/config.yml

PLAY [Populate config host groups] 
 

TASK: [fail ] 
* 
skipping: [localhost]

TASK: [fail ] 
* 
skipping: [localhost]

TASK: [fail ] 
* 
skipping: [localhost]

TASK: [fail ] 
* 
skipping: [localhost]

TASK: [Evaluate oo_etcd_to_config] 
 
skipping: [localhost]

TASK: [Evaluate oo_masters_to_config] 
* 
ok: [localhost] => (item=192.168.144.132)

TASK: [set_fact ] 
* 
ok: [localhost]

TASK: [Evaluate oo_nodes_to_config] 
*** 
ok: [localhost] => (item=192.168.144.128)
ok: [localhost] => (item=192.168.144.129)

TASK: [Evaluate oo_nodes_to_config] 
*** 
skipping: [localhost] => (item=192.168.144.132)

TASK: [Evaluate oo_first_etcd] 
 
skipping: [localhost]

TASK: [Evaluate oo_first_master] 
** 
ok: [localhost]

TASK: [Evaluate oo_lb_to_config] 
** 
skipping: [localhost]

PLAY [Set etcd facts needed for generating certs] 
* 
skipping: no hosts matched

PLAY [Create temp directory for syncing certs] 
 

TASK: [Create local temp directory for syncing certs] 
* 
ok: [localhost -> 127.0.0.1]

PLAY [Configure etcd certificates] 
 
skipping: no hosts matched

PLAY [Configure etcd hosts] 
*** 
skipping: no hosts matched

PLAY [Delete temporary directory on localhost] 
 

TASK: [file name={{ g_etcd_mktemp.stdout }} state=absent] 
* 
ok: [localhost]

PLAY [Set master facts and determine if external etcd certs need to be 
generated] *** 

GATHERING FACTS 
*** 
ok: [192.168.144.132]

TASK: [Check for RPM generated config marker file .config_managed] 
 
ok: [192.168.144.132]

TASK: [Remove RPM generated config files if present] 
** 
skipping: [192.168.144.132] => (item=master)
skipping: [192.168.144.132] => (item=node)
skipping: [192.168.144.132] => (item=.config_managed)

TASK: [set_fact ] 
* 
ok: [192.168.144.132]

TASK: [openshift_facts | Verify Ansible version is greater than 1.8.0 
and not 1.9.0 and not 1.9.0.1] *** 
ok: [192.168.144.132]

TASK: [openshift_facts | Ensure PyYaml is installed] 
** 
ok: [192.168.144.132] => (item=PyYAML)

TASK: [openshift_facts | Gather Cluster facts] 
 
failed: [192.168.144.132] => 

[ansible-project] ansible galaxy question

2015-12-02 Thread Serge S
hi,

I'm wondering is it a good way share a complete playbook using the ansible 
galaxy. 

and yes, I've read documentation:" Instead of creating giant playbooks with 
hundreds of tasks we can use roles to organise tasks,  "

however, the role approach is not suitable for complex cluster applications 
when services(roles) depend on each other and in the turn depends on hosts.
also, as I understand, ansible galaxy is not supposed to deliver the ready 
to use solution - it just provides recipes and  makes a user to _create_a 
playbook( cut and paste)  
according to the provided by the role documentation - so it's not  even 
supposes to deliver a ready to use playbook/template configuration file - 
am I wrong ?

what I think:
well, consider a regular book you are eventually reading. if you apply the 
ansible galaxy approach to the human reading books, than the book store 
should look like a swedish table where you can pick chapters like  'crime', 
'love','nature','programming in 24 hours', 'happy end', etc - and compose 
your own book.

so the another question:
do I understand the ansible-galaxy correctly or did I miss any thing ?

the questions are not abstract - I have the playbook - 
https://github.com/sergevs/ansible-cloudera-hadoop 
which is tested, documented, doing that it states and I hope is really easy 
to use for the end user.
I do think that If I would try to broke it to ansible galaxy roles it will 
ruin the work and make it unusable for the end user with unpredictable 
final result.

I really would appreciate ansible galaxy experts advices.

thanks,
Serge.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fcdbcaa5-7202-4ca5-8c4e-dd42bd8c145e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unable to create /etc/ansible/facts.d/openshift.fact, permission denied

2015-12-02 Thread Andrew Edelstein
It's not giving an error on your local system. That's telling you that
whatever file your task is touching on the remote ("managed") system, the
user that is running the command doesn't have permission to modify the
file. So what this is telling you is that the user that is running the
specific task (the user that logged into the remote machine, not the user
that is running the ansible playbook) does not have permission to write to
/etc/ansible. Check what user is making the connection on the remote system
/ what user it is logging INTO that system as, and if you need to add
"sudo: yes" and/or "sudo_user: username" to the play. This applies EVEN IF
THE REMOTE MANAGED MACHINE IS THE SAME MACHINE FROM WHICH YOU ARE RUNNING
ANSIBLE. IE: If you're running a play on "localhost", running ansible
inside sudo doesn't change the user you're logging into localhost with, and
thus what permissions that user has on localhost.

On Wed, Dec 2, 2015 at 5:57 PM, Suryaveer Chauhan <
chauhan.suryav...@gmail.com> wrote:

> Hi All,
>
> I am a newbie to ansible.
>
> I am following this blog
> 
> to install OpenShift Origin V3 on OpenStack using ansible. But I am getting
> error as below:
>
> * "Could not create fact file: %s, error: %s" % (filename, ex)*
> * __main__.OpenShiftFactsFileWriteError: Could not create fact file:
> /etc/ansible/facts.d/openshift.fact, error: [Errno 13] Permission*
> * denied: '/etc/ansible/facts.d'*
>
> The target system is Centos and I can do passwordless sudo on the target
> systems. I even added in /etc/sudoers
>
>  centos All=(ALL) NOPASSWD:ALL
>
> to all the nodes and also on the system from which I am running ansible.
>
> From the system I run ansible, I tried executing as sudo, as root but same
> results.
>
> I am not sure where it faces permission denied, I mean on the host or the
> target systems.
>
> *Ansible vars:*
>
> [OSEv3:vars]
> ansible_ssh_user=centos
> ansible_sudo=true
>
> *Ansible.cfg*
>
> [defaults]
> hostfile = ansible_hosts
> remote_user = centos
> host_key_checking = False
>
> Below is the full log:
>
> root@ubuntu:/home/suryaveer# ansible all -m ping
> 192.168.144.129 | success >> {
> "changed": false,
> "ping": "pong"
> }
>
> 192.168.144.128 | success >> {
> "changed": false,
> "ping": "pong"
> }
>
> 192.168.144.132 | success >> {
> "changed": false,
> "ping": "pong"
> }
>
> root@ubuntu:/home/suryaveer# ansible-playbook
> openshift-ansible/playbooks/byo/config.yml
>
> PLAY [Populate config host groups]
> 
>
> TASK: [fail ]
> *
> skipping: [localhost]
>
> TASK: [fail ]
> *
> skipping: [localhost]
>
> TASK: [fail ]
> *
> skipping: [localhost]
>
> TASK: [fail ]
> *
> skipping: [localhost]
>
> TASK: [Evaluate oo_etcd_to_config]
> 
> skipping: [localhost]
>
> TASK: [Evaluate oo_masters_to_config]
> *
> ok: [localhost] => (item=192.168.144.132)
>
> TASK: [set_fact ]
> *
> ok: [localhost]
>
> TASK: [Evaluate oo_nodes_to_config]
> ***
> ok: [localhost] => (item=192.168.144.128)
> ok: [localhost] => (item=192.168.144.129)
>
> TASK: [Evaluate oo_nodes_to_config]
> ***
> skipping: [localhost] => (item=192.168.144.132)
>
> TASK: [Evaluate oo_first_etcd]
> 
> skipping: [localhost]
>
> TASK: [Evaluate oo_first_master]
> **
> ok: [localhost]
>
> TASK: [Evaluate oo_lb_to_config]
> **
> skipping: [localhost]
>
> PLAY [Set etcd facts needed for generating certs]
> *
> skipping: no hosts matched
>
> PLAY [Create temp directory for syncing certs]
> 
>
> TASK: [Create local temp directory for syncing certs]
> *
> ok: [localhost -> 127.0.0.1]
>
> PLAY [Configure etcd certificates]
> 
> skipping: no hosts matched
>
> PLAY [Configure etcd hosts]
> ***
> skipping: no hosts matched
>
> PLAY [Delete temporary directory on localhost]
> 
>
> TASK: [file name={{ g_etcd_mktemp.stdout }} state=absent]
> *
> 

Re: [ansible-project] --start-at-task seems broken on 2.0.0-stable

2015-12-02 Thread Brandon Heller
Thanks Brian.

Did you have a chance to talk to other devs?  Is this a conversation I 
could join in?

We've now switched internally to 2.0.0 but I'm finding a lot of debugging 
much slower, as I have to use a mix of tags and temporary commenting-out to 
get playbooks working.

Thanks,
-b


On Tuesday, December 1, 2015 at 12:16:37 AM UTC-8, Brian Coca wrote:
>
> I think they should 'just work' TM, but this is not a simple one, 
> having dynamic includes makes this an 'interesting' problem, checking 
> with other devs trying to figure this out. 
>
> -- 
> Brian Coca 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d7175c5d-7adf-4a91-9dfc-819a45735333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] # of ssh connections / timeout function?

2015-12-02 Thread Andrew Edelstein
Another one of those "it depends" answers.
You can configure Ansible to use either Open-ssh client or the parameko
client. Parameko is the default and usually performs better, with fewer
permissions headaches (though it still uses ~/.ssh/known_hosts and
~/.ssh/id_rsa.pub, etc...)
My observation is that ansible will pick the order in which it connects to
managed hosts in a non-deterministic fashion, thus if your playbook
performs an task on a host, then, due to timing/selection of host/task to
do next/whatever variable in your network causes connections to initiate
slowly, it may turn around and immediately reconnect to a host on which it
just completed a task to perform the next task.
There are parameters you can tune in your ansible.cfg that will allow you
to pipeline multiple tasks through the same SSH connection. I played around
with them a little bit when having some issues on our network, but
ultimately went back to the defaults due to some mis-guided "requiretty"
settings sudo settings on the managed hosts, on the part of SAs that
predate my tenure at {POE}.)

See
http://docs.ansible.com/ansible/intro_configuration.html#paramiko-specific-settings
(And the next two sections on Open-ssh specific settings, and Accelerated
Mode settings) for more information.


On Wed, Dec 2, 2015 at 2:04 PM, richard kappler 
wrote:

> This is a two part question. I sort of worked around the problem I asked
> about yesterday (third task crashes on third of 4 machines) by splitting up
> my playbook into 3 parts. Ugly, but for now it works, at least on four
> machines at a time, testing bigger inventory now.
>
> *Possibly pertinent information:* We deploy into a closed network (behind
> a vpn) which is composed of over 500 vm's on hardware spread across the US.
> The ssh connection to these machines is SLOW due to a config problem that I
> am not, at the moment, allowed to correct. As such, it ca take as long a
> two + minutes from when I request an ssh connection to when it actually
> establishes. Again, I know what the issue is and how to fix it, but am not
> allowed to at the moment.
>
> *What I've noticed:* as ansible moves through the playbook, it moves up
> and down the inventory list. In other words, it will start task one on
> machine one (of 5 let's say) and move sequentially (seemingly in pairs)
> through to machine 5, then the next task starts on machine 5 and moves up
> the list from 4 to 3 to 2 to 1. I've notice that each task executes quickly
> on the first two machines in a task, and that they were the last two
> machines in the previous task. I've also noted that each task is executed
> quite quickly on a consecutive pair of machines (regardless of geographic
> location btw) but then there is a lonnng delay between the same task
> executing on the next pair.
>
> *Questions: *This leads me to wonder: is there a timeout occurring in
> ansible? Does it actually open ssh tunnels in pairs?
>
> I can't fix the built in delay in the vm's right now, so am hoping to make
> changes in ansible until this can be fixed in the hosts, but right now my
> suspicions that the process is timing out due to long delay between the
> starting pair of one task until they are the end pair of the next task is
> causing some sort of time out issue.
>
> Then again my theory could be hooey and we're just cursed. :-(
>
> regards, Richard
>
> ps: while I wrote the above I was running a playbook that makes a
> directory and moves and untars a 14.5 MB file using unarchive. This worked
> fine on a 4 machine inventory. It crashed on the unarchive task after the
> third machine.
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e0640ea3-d3a1-4c3c-bfc0-dae3d163ec7e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BscPs5W5ijgzvhkFJG-TsmyZ7vgPi7mtL1R2emk%3DNBJ%2BPMQ-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] --start-at-task seems broken on 2.0.0-stable

2015-12-02 Thread Brian Coca
Currently, this is the price we are paying for the dynamic 'task
includes', we are looking for ways around this issue but have not
found anything we are happy with yet.

-- 
Brian Coca

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8%3DfzdN7P6GOSjvszBKWuBKbCyUA8FgVAHEToyOFoX1MjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Raw module and interactive commands

2015-12-02 Thread Tim Fletcher
On 02/12/15 03:23, pspryg...@ansible.com wrote:
> What switch are you trying to send commands to?   
> 
> We have started to incorporate network device support into the
> module_utils for connecting to interactive devices over ssh with initial
> support for IOS based devices.   See here for the IOS shared module
> support (https://github.com/ansible/ansible/pull/13358/files) and here
> (https://github.com/ansible/ansible-modules-core/pull/2587/files) for an
> example module

That's great news, especially as I have written an ugly bit of bash this
week to bulk unset and reset the correct ntp servers on all out Cisco
switches...

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/565F8694.3010205%40night-shade.org.uk.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[ansible-project] anyone know how to pass extra_vars in tower callback via curl?

2015-12-02 Thread Adrian Black
Anybody any idea how to pass in extra_vars when doing a callback request to 
tower?

https://docs.ansible.com/ansible-tower/2.2.0/html/userguide/job_templates.html#ug-provisioning-callbacks

I cant see how you can combine json blob with name=value fields in a single 
curl request.

The response i have had from ansible support is this gist
https://gist.github.com/michelleperz/fcca30f11bcaa2d1c52f

which i cant see as solving the problem.




-- 


This message is private and confidential and for the exclusive use of the 
intended recipient(s). If you receive this email in error, please notify 
the sender immediately and delete all copies from your system. If you are 
not the intended recipient disclosure, distribution, copying or use of this 
communication is strictly prohibited. Any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of IDG UK. Clients and suppliers can view our full terms and 
conditions at www.idg.co.uk/terms-and-conditions/


IDG Communications Ltd. Company Reg No: 1197840. Registered in England and 
Wales.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9b51fcc4-6c20-4411-a395-61cec143c60f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Best Practice.

2015-12-02 Thread Jason Morgan
I am currently developing a Playbook consisting of a number of roles via 
include statements as show below:

hosts: testing
   sudo: yes
   roles:
   - timezone
   - ntp
   - mariadb
   - nfs-server

I would appreciate some advice of where to put all the varables for the 
server eg Database , NFS exports, Timezone etc Would they be added as vars: 
in the main playbook ? As vars under a host_vars directory ?

Thanks Jason

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3359062a-431a-44c7-b38a-dbc5e4621235%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] anyone know how to pass extra_vars in tower callback via curl?

2015-12-02 Thread Matt Martz
For tower questions please use supp...@ansible.com or
https://support.ansible.com

This email list is for the open source Ansible project.


On Wednesday, December 2, 2015, Adrian Black  wrote:

> Anybody any idea how to pass in extra_vars when doing a callback request
> to tower?
>
>
> https://docs.ansible.com/ansible-tower/2.2.0/html/userguide/job_templates.html#ug-provisioning-callbacks
>
> I cant see how you can combine json blob with name=value fields in a
> single curl request.
>
> The response i have had from ansible support is this gist
> https://gist.github.com/michelleperz/fcca30f11bcaa2d1c52f
>
> which i cant see as solving the problem.
>
>
>
>
> This message is private and confidential and for the exclusive use of the
> intended recipient(s). If you receive this email in error, please notify
> the sender immediately and delete all copies from your system. If you are
> not the intended recipient disclosure, distribution, copying or use of this
> communication is strictly prohibited. Any views or opinions presented in
> this email are solely those of the author and do not necessarily represent
> those of IDG UK. Clients and suppliers can view our full terms and
> conditions at www.idg.co.uk/terms-and-conditions/
>
>
> IDG Communications Ltd. Company Reg No: 1197840. Registered in England and
> Wales.
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to ansible-project@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9b51fcc4-6c20-4411-a395-61cec143c60f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-skj%3D4obq7HbkBiUn1DsueJAsdBMmmTt6C1FYuKEA9rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.