[ansible-project] Re: Ansible copy file on remote machines on different location.

2017-03-09 Thread niraj pandey
Can someone please help me on this.

On Friday, March 3, 2017 at 3:24:46 PM UTC+5:30, niraj pandey wrote:
>
> I tried this but it copying the file on both the location on both the 
> machines.
>
> On Friday, March 3, 2017 at 3:03:04 PM UTC+5:30, niraj pandey wrote:
>>
>>
>>
>> down votefavorite 
>> 
>>
>> How can I copy a file from machine A to machine B and machine C on 
>> different location. ie:
>>
>> On machine A I have file abc and I want to copy it on the /tmp area of 
>> machine B and /opt area of  machine C.
>>
>>
>> I tried this so far:
>>
>>
>> *My inventory file:*
>>
>>
>> [webserver]
>>
>> machine-B dst=/tmp
>>
>> machine-C dst=/opt
>>
>>
>> *Playbook:*
>>
>>
>> - hosts: webserver
>>
>>   tasks:
>>
>> - name: Transfer file from ServerA to ServerB
>>
>>   synchronize:
>>
>> src: /home/niraj/ansible_testing
>>
>> dest: "{{ hostvars[item]['dst'] }}"
>>
>>   with_items: "{{ groups['webserver'] }}"
>>
>> #dest: /home/niraj
>>
>> #mode: pull
>>
>>   delegate_to: machine-A
>>
>

-- 
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/6679deeb-1f20-4822-a772-3c2de5da6558%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Suggestion: version-specific documentation

2017-03-09 Thread Brian Coca
One thing that guarantees that the docs are specific to your version
`ansible-doc` it shows the same module docs (same info is used to
render html) but uses your 'current' modules.


--
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/CACVha7eDJ8iq8pZRJOQpAxkW_ad3N-0zvTPxi_5A009Qaf%3D%2B9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Suggestion: version-specific documentation

2017-03-09 Thread Guy Knights
One thing I find a little frustrating about the online documentation for
Ansible is that there's no way to look at the docs for a specific version.
I realise that a lot of people just use the devel branch but there are
those of us that stick to a specific version.

When I'm looking at the docs for a particular module it's easy to overlook
the notes specifying which version of Ansible that module or module
parameter was added as they're spread throughout the module documentation
page.

I think it would be better to have separate docs per major version, like
the Apache docs for example (https://httpd.apache.org/docs/). There could
also be a "latest" version for the devel branch.

I did a bit of a search through the mailing list and found this thread from
2013 discussing the same thing but it doesn't look like it came to fruition:

https://groups.google.com/forum/#!searchin/ansible-project/version$20documentation%7Csort:relevance/ansible-project/2Xi6xkyPEsY/ye418hhlYwwJ

Regards,
Guy

-- 
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/CANNH9mvu8bbf1S-1a4nhhi0T0rNQR_1bs7qS6xGMnZi%2B9zhSfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Escaping a single backslash in the "replace" part of a regex_replace

2017-03-09 Thread Dick Visser
Your regex is fine, and there is really only one backslash in the output.
It's the escaping of debug that is fooling you.
Try adding this task and check the content:

- copy:
dest: /tmp/test
content: "{{ ini }}"

Dick

On 8 March 2017 at 12:40, 'akuma d' via Ansible Project
 wrote:
> Hi,
> I need to replace a dot in a string with a "\!". I am using "regex_replace"
> but am unable to get the regex to print a single backslash.
>
> I have tried escaping it using double-backslash but that gives me 2
> backslashes in the output. Interestingly escaping using 4 backslashes also
> gives 2 backslashes in the output - so could this be a bug?
>
> Ansible version is 2.2.1.0
>
>
> ---
> - name: install MQ 8
>   hosts: 192.168.90.84
>   vars:
> qmgr: PAAA.QMGR
>   tasks:
> - debug:
> msg: "{{ ini }}"
>   vars:
> ini: "{{ qmgr | regex_replace('[.]','\\!') }}"
>
>
>
> Here is the output:
>
> TASK [debug]
> ***
> ok: [192.168.90.84] => {
> "msg": "PAAA\\!QMGR"
> }
>
>
> 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/6308c90f-8ac5-42d0-9ba6-ed8ba4841eda%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

-- 
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/CAL8fbwMcs3PPA9TvALKcch7id2mhs_5P4g0vtgw1Q%2BYBBtfGCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Codedeploy Support

2017-03-09 Thread stark
Thanks for the reply. Looks like you are right, the tools are there, just 
no one has done it yet. I've never contributed to the Ansible codebase 
before but Ill take a stab at it over the next couple weekends and see if I 
can't get something better than using the "command: aws deploy 
create-application" approach I've been using until now.

-- 
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/d3f7006f-4206-4098-a2f7-70a08ab2af65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Dealing with Inventory File Proliferation

2017-03-09 Thread Spike
I'm facing a similar problem and the way I'm looking at solving it is
dynamic inventories. I've also considered using multiple inventories +
symlinks (nto sure that works tho). See:
http://docs.ansible.com/ansible/intro_dynamic_inventory.html#using-inventory-directories-and-multiple-inventory-sources

I have all my hosts in an external data source, tagged, so I could easily
have multiple tags to include hosts in different inventories and then
generate them at runtime. This way management is as simple as adding an
entry to the hosts table and one or more tags in the tags column.

hope that helps,

Spike

On Thu, Mar 9, 2017 at 12:01 AM David Lane 
wrote:

> Hi,
>
> I've inherited a complex deployment system which is steadily getting more
> complex. This is fine, except we also have multiple instances of this
> system (several variants of Production and Dev plus many, many developer
> instances).
>
> Currently all of our inventory files are long, very similar files with one
> or two things tweaked appropriately. This makes maintenance a nightmare
> where for every time I need to modify a feature, add a variable or remove
> something I have to manually edit upwards of ten non-trivial inventories.
>
> Has anyone been in this sort of situation before?
>
> Sorry for the lack of detail, I'm at the state where I've wondered around
> poking various ideas for long enough that I haven't really got a clear
> direction and my brain's gone fuzzy.
>
> Cheers,
>
> David
>
> --
> 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/ff9183b3-f019-4c3e-98b0-e3231cf88ad6%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/CAPE6YbSUw1%3DvTJzbq61ju2f6Q277PtGMTKkWAccxd5TWwgtkVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installation issue (asciidoc error)

2017-03-09 Thread Dick Visser
hi

You're missing the asciidoc package, which provides the a2x command.
Did you install that (as per docs at
http://docs.ansible.com/ansible/intro_installation.html#latest-release-via-yum)?

Dick

On 8 March 2017 at 16:55, Rajesh Shan  wrote:
> I tried to install Ansible in RHEL 7.2 server. But it give the following
> error :
>
> [root@ip-172-31-23-152 ansible]# make rpm
> sed "s/%VERSION%/2.3.0/" docs/man/man1/ansible.1.asciidoc.in >
> docs/man/man1/ansible.1.asciidoc
> ERROR: AsciiDoc 'a2x' command is not installed but is required to build
> docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1
> docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1
> docs/man/man1/ansible-galaxy.1 docs/man/man1/ansible-vault.1
> make: *** [docs/man/man1/ansible.1] Error 1
> rm docs/man/man1/ansible.1.asciidoc
>
>
> Could you please send us docs or steps to resolve this error.
>
> --
> 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/78a8c037-f6a1-4a03-84e8-918dfd9ac293%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

-- 
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/CAL8fbwOPSUTj0v%2BXQwBazLEnZxVwytafmmqzaYV1KptA51Amhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] deployment notifications - for all cases - OK and failed.

2017-03-09 Thread epiq sty
I've got the reason of 404 error. Seem's that 

+SLACK_CHANNEL (optional): Slack room to post in. Default: 
#ansible

is not optional - as we have not special #ansible channel in our slack , we 
use *another *channel for testing deploys notification.

So callback start sending messages to slack only after specifying *another 
*channel 
via env.

It seem's strange, because  SLACK_WEBHOOK_URL at fact issued to some 
default channel, but if it's not #ansible - you will get such 404 error.



On Tuesday, 28 February 2017 15:29:42 UTC+1, epiq sty wrote:
>
> Thanks,
>
> I have tried, but got :
>
>  [WARNING]: Could not submit message to Slack: HTTP Error 404: Not Found
>
>
>
> error
>
> Can you please advise, what else can be wrong here?
>
> $ source .slack 
> $ more .slack
> SLACK_WEBHOOK_URL=https://hooks.slack.com/services/aaa/bbb/ccc
> export SLACK_WEBHOOK_URL
> $ grep slack ansible.cfg 
> callback_whitelist = slack
>
>
> On Thursday, 23 February 2017 11:37:01 UTC+1, Stankovic, Marko wrote:
>>
>> Hi, 
>>
>> Maybe Slack callback plugin would work better for you? 
>>
>> Enable it by adding slack to the callback_whitelist in 
>> /etc/ansible/ansible.cfg 
>>
>> http://docs.ansible.com/ansible/intro_configuration.html#callback-whitelist 
>>
>> Here's documentation from the plugin itself: 
>> https://github.com/ansible/ansible/pull/13408/files 
>> This is an ansible callback plugin that sends status 
>> updates to a Slack channel during playbook execution. 
>>
>> This plugin makes use of the following environment variables: 
>> SLACK_WEBHOOK_URL (required): Slack Webhook URL 
>> SLACK_CHANNEL (optional): Slack room to post in. Default: 
>> #ansible 
>> SLACK_USERNAME(optional): Username to post as. Default: 
>> ansible 
>> SLACK_INVOCATION  (optional): Show command line invocation 
>>   details. Default: False 
>>
>> Requires: 
>> prettytable 
>> CONFIDENTIALITY NOTICE: This message is the property of International 
>> Game Technology PLC and/or its subsidiaries and may contain proprietary, 
>> confidential or trade secret information. This message is intended solely 
>> for the use of the addressee. If you are not the intended recipient and 
>> have received this message in error, please delete this message from your 
>> system. Any unauthorized reading, distribution, copying, or other use of 
>> this message or its attachments is strictly prohibited. 
>>
>

-- 
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/cb5cab11-c14c-41a2-8ea8-e3aa3c18c71e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Setup module finding package information

2017-03-09 Thread Kai Stian Olstad

On 07.03.2017 17:15, Drew Mullen wrote:

Can the setup module provide information like:

- is java install?
- which versions are installed?
- where are they installed?


I noticed in my first test run of the module that python is 
investigated

but didn't see other software / tools (or in the source code).


Not out of the box, but you add facts yourself with local facts
https://docs.ansible.com/ansible/playbooks_variables.html#local-facts-facts-d

--
Kai Stian Olstad

--
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/4a532f9cd787b7e15eaf75690fa9c384%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] RDS

2017-03-09 Thread daniel
Hi i an mew to ansible and i cant get an rds snapshot to be deployed using 
ansible. can enyone send me an working yml file that i can rebuild it in my 
DR script please

Disclaimer
The information contained in this communication from the sender is confidential 
and may be legally 
privileged. It is intended solely for use by recipient and others authorized to 
receive it. If you 
are not the recipient you are hereby notified that any disclosure, copying, 
distribution or taking 
action in reliance of the contents of this information is strictly prohibited 
and may be unlawful.

-- 
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/16abedba-11f5-4622-b75e-395cd3e5843c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Setup module finding package information

2017-03-09 Thread Drew Mullen
Can the setup module provide information like:

- is java install?
- which versions are installed?
- where are they installed?


I noticed in my first test run of the module that python is investigated 
but didn't see other software / tools (or in the source code).


-- 
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/35f4693c-2faa-4ff6-a46d-939ea51700e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Dealing with Inventory File Proliferation

2017-03-09 Thread David Lane
Hi,

I've inherited a complex deployment system which is steadily getting more 
complex. This is fine, except we also have multiple instances of this 
system (several variants of Production and Dev plus many, many developer 
instances).

Currently all of our inventory files are long, very similar files with one 
or two things tweaked appropriately. This makes maintenance a nightmare 
where for every time I need to modify a feature, add a variable or remove 
something I have to manually edit upwards of ten non-trivial inventories.

Has anyone been in this sort of situation before?

Sorry for the lack of detail, I'm at the state where I've wondered around 
poking various ideas for long enough that I haven't really got a clear 
direction and my brain's gone fuzzy.

Cheers,

David

-- 
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/ff9183b3-f019-4c3e-98b0-e3231cf88ad6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] datacenter inventory layout recommendations

2017-03-09 Thread jerry
Hi,
We are looking at deploying ansible as our new automation base. we 
currently have 1500-2000 machines to manage in multiple data centers. We 
also have 50+ app/services type that we have written internally as well as 
the standard infrastructure servers and such.

It seems like getting the inventory layout right is critical to making it 
easy build templates and playbooks. My current test is to be able to 
generate our load balancer configs for about 25 of our services (some have 
built in load balancers.) I want to be able to do the following:
define a service
   say which addresses and ports it listen on
   make all the instances in the local data center have weight 100
   make all the instances in the secondary data center weight N
   for each instance, look up the host and port that it is listening on

define the set of services that this load balancer is serving

I have been getting better at template programming, but I just don't have a 
feel for the best way to lay out the inventory data. This one thing I would 
really hate to redo.

If there are folks running similar types of environments, I would love to 
hear what has worked and what you would do differently. You can either 
reply here or contact me privately. If you are in the silicon valley, I 
would love to buy you a cup of coffee and chat.

thanks in advance,
jerry

-- 
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/13e0d795-8cf4-4bf9-9aee-74a713da3ebc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: file module: absent recurse=yes and Directory not empty

2017-03-09 Thread Diego Villacis
Getting the same error, does anyone know if there is any update on this?

On Friday, April 4, 2014 at 8:48:33 AM UTC-5, Maxim Odinintsev wrote:
>
> Hello,
>
> When I'm run this job, but on some hosts return output:
> rmtree failed: [Errno 39] Directory not empty: 
> '/home/master/www/static.master/images/posters'
>
> Sure this directories is not empty, and I'm want remove it recursive. But 
> why i can't do this with file module ?
>
> - name: Cleaner
>   hosts: all
>   sudo: yes
>
>   tasks:
> - name: get cache dirs
>   shell: ls -1 /var/lib/nginx/cache/
>   register: cache
>
> - name: Remove cache
>   file: name=/var/lib/nginx/cache/{{ item }} state=absent recurse=yes
>   with_items: cache.stdout_lines
>
> - name: get static dirs
>   shell: ls -1 /home/master/www/static.master/
>   register: static
>
> - name: Clean static
>   file: name=/home/master/www/static.master/{{ item }} state=absent 
> recurse=yes
>   with_items: static.stdout_lines
>
>
> Thank you
>

-- 
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/785daae8-9136-4d49-9103-769e335d2ad2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to read the --limit command line option

2017-03-09 Thread Marco Buttu
Hi all, I would like to get the value of --limit. For instance, let's have 
this command:

$ ansible-playbook site.yml --limit foo

I would like to read {{ limit }} from a task. Is there a solution or do I 
have to do something like the following?

$ ansible-playbook site.yml --limit foo -e "limit=foo"

Thanks, Marco

-- 
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/32cc5b27-ee9e-4848-be04-96952a26afb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to use extra ansible modules?

2017-03-09 Thread Chang Zhi
hi, I'm a new man to using ansible. I have some simple questions about how 
to use ansible modules. I want to use the openvswitch module[1]. What 
commands should I execute ? Should I use " ansible " or "ansible-playbook" 
? 


Thanks
Zhi Chang

[1]: http://docs.ansible.com/ansible/ops_config_module.html

-- 
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/e086bba3-3d05-4fb5-93f1-27cda0a92acb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ec2 fails on botocore / boto3 required

2017-03-09 Thread AutoMac
Running on Mac with Sierra and using Ansible v 2.2.1.0, with the  latest 
versions of pip, botocore, boto3 installed.   Tried uninstalling and 
reinstalling and power cycled the system.  Also tried running with elevated 
privileges with out success. 
Failed on Nat gateway  with error  "botocore/boto3 is required.

-- 
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/9ec60c03-332d-491f-a776-a5193e192c03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Roles, vars, defaults, and pre_tasks.

2017-03-09 Thread Dan Linder
I'm trying to split up a large playbook into roles and it's going pretty 
well except I'm having trouble with variables not being pulled in from the 
roles vars or defaults files.

My playbook has this test playbook with a pre_task:

---
- hosts: all

#  vars:
#doreboots: true
#zadmin_password: Today123zadmin
#root_password: Today123

  pre_tasks:
- debug:
msg: "Playbook WILL REBOOT when requested."
  when: doreboots

  roles:
- setup_ansible_data


I've moved the "vars:" section (commented out above) to the main.yml files 
in both the "vars" and "defaults" directories like this:

---
  doreboots: true


When the playbook is run, I get this error:

TASK [debug] 
***
fatal: [system.example.com]: FAILED! => {"failed": true, "msg": "The 
conditional check 'doreboots' failed. The error was: error while evaluating 
conditional (doreboots): 'doreboots' is undefined\n\nThe error appears to 
have been in '/etc/ansible/roles/sysprep/test.yml': line 10, column 7, but 
may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n  pre_tasks:\n- debug:\n  ^ 
here\n"}


Or more human readable:

The conditional check 'doreboots' failed. The error was: error while 
evaluating conditional (doreboots): 'doreboots' is undefined

The error appears to have been in '/etc/ansible/roles/sysprep/test.yml': 
line 10, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  pre_tasks:
- debug:
  ^ here


Thoughts?

Thanks!
Dan

-- 
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/e8392e82-92ad-42ee-8ff6-2d4156da8e8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-09 Thread Jon Stanley
On Tue, Mar 7, 2017 at 2:49 AM, Mona Gopal  wrote:
>
> Have been referring to the below link, but hasn't been of much help:
> https://www.djouxtech.net/posts/ansible-on-aix/

Not an AIX expert (or even novice), but in what way has this not been
of help? It explains what the pre-requisites are (a working Python 2
interpreter - and how to get there on AIX) and SSH. What part of that
are you having problems with? What error messages are produced?

A more specific inquiry is more likely to yield solutions.

-- 
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/CALY6xnhPfRO7a8rS_d4SGyqSiULjqLYB3VQSEbrPtkK2ck5cxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Escaping a single backslash in the "replace" part of a regex_replace

2017-03-09 Thread 'akuma d' via Ansible Project
Hi,
I need to replace a dot in a string with a "\!". I am using "regex_replace" 
but am unable to get the regex to print a single backslash.

I have tried escaping it using double-backslash but that gives me 2 
backslashes in the output. Interestingly escaping using 4 backslashes also 
gives 2 backslashes in the output - so could this be a bug?

Ansible version is 2.2.1.0


---
- name: install MQ 8
  hosts: 192.168.90.84
  vars:
qmgr: PAAA.QMGR
  tasks:
- debug:
msg: "{{ ini }}"
  vars:
ini: "{{ qmgr | regex_replace('[.]','\\!') }}"



Here is the output:

TASK [debug] 
***
ok: [192.168.90.84] => {
"msg": "PAAA\\!QMGR"
}


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/6308c90f-8ac5-42d0-9ba6-ed8ba4841eda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible on Windows host with two FQDNs

2017-03-09 Thread MKPhil
Hi,
I posted a similar question over on Stack Overflow but without any helpful 
replies so I thought I'd try this group too...  I don't think it is an 
Ansible question per se but has arisen from our use of Ansible

We have Windows servers with two NICs, two separate IPs and two FQDNs in 
DNS, e.g.

> SERVER01.ADdomain.company.corp [10.0.0.1]

SERVER01.management.company.corp [192.168.0.1]


Both are configured in Windows and I can RDP, Telnet, HTTP or whatever to 
both names and both IPs (assuming firewalls & routing are configured 
correctly and there is something listening on the relevant ports).  This 
set-up is primarily to enable our management traffic (e.g. Backups) to 
communicate over an alternative NIC to the primary traffic.

WinRM has been configured (using the ConfigureRemotingForAnsible.ps1 
script) and I can prove that it works if I use Ansible or PowerShell on the 
AD name:

> $ ansible -m win_ping SERVER01.ADdomain.company.corp
> SERVER01.ADdomain.company.corp | SUCCESS => {
> "changed": false,
> "ping": "pong"
> }


PS> Invoke-Command -scriptblock{hostname} -ComputerName 
> SERVER01.ADdomain.company.corp

SERVER01 

 

 My problems come when I try to use the other FQDN.  Ansible returns:

> SERVER01.management.company.corp | UNREACHABLE! => {
> "changed": false,
> "msg": "kerberos: authGSSClientStep() failed: (('Unspecified GSS 
> failure.  Minor code may provide more information', 851968), ('Server not 
> found in Kerberos database', -1765328377)), ssl: the specified credentials 
> were rejected by the server",
> "unreachable": true
> }

 
And PowerShell sayeth:

> [SERVER01.management.company.corp] Connecting to remote server 
> SERVER01.management.company.corp failed with the following error message : 
> WinRM cannot process the request. The following error occurred while using 
> Kerberos authentication: Cannot find the computer 
> SERVER01.management.company.corp. Verify that the computer exists on the 
> network and that the name provided is spelled correctly. For more 
> information, see the about_Remote_Troubleshooting
> Help topic.
> + CategoryInfo  : OpenError: 
> (SERVER01.management.company.corp:String) [], PSRemotingTransportException
> + FullyQualifiedErrorId : NetworkPathNotFound,PSSessionStateBroken



>From reading about this I think it is because the Kerberos Authentication 
that WinRM uses only works on the AD name but my question is this: Is there 
any way to get the Ansible/WinRM/PowerShell working using the second FQDN? 
If not, why not? Any documents (particularly from Ansible and/or Microsoft) 
to back this up would be appreciated.

Cheers
Phil




 

-- 
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/709b1fc3-0995-4743-9b92-f32817db48f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to get the --limit command line option

2017-03-09 Thread Marco Buttu
Hi all, I would like to read the --limit command line option. For instance, 
let's have the following:

$ ansible-playbook site.yml --limit foo

I would like the tasks to read {{ limit }}. Is it possibile or do I have to 
duplicate thinks like in the following?

$ ansible-playbook site.yml --limit foo --extra-vars "limit=foo"

Thanks, Marco

-- 
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/2504b367-82a7-4744-b6e8-d7a0a6659944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Installation issue (asciidoc error)

2017-03-09 Thread Rajesh Shan
I tried to install Ansible in RHEL 7.2 server. But it give the following 
error :

[root@ip-172-31-23-152 ansible]# make rpm
sed "s/%VERSION%/2.3.0/" docs/man/man1/ansible.1.asciidoc.in > 
docs/man/man1/ansible.1.asciidoc
ERROR: AsciiDoc 'a2x' command is not installed but is required to build 
docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 
docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 
docs/man/man1/ansible-galaxy.1 docs/man/man1/ansible-vault.1
make: *** [docs/man/man1/ansible.1] Error 1
rm docs/man/man1/ansible.1.asciidoc


Could you please send us docs or steps to resolve this error.

-- 
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/78a8c037-f6a1-4a03-84e8-918dfd9ac293%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.