Re: [ansible-project] I cant create a simple .txt file using ansible.

2017-12-04 Thread Muhammad Mahir
I'am using "ansible cassandra -m ping " or "ansible all -m ping " and is 
can easily ssh also but the moment I run the playbook it shows me this 
error.


On Monday, December 4, 2017 at 8:33:38 PM UTC+5, Dick Visser wrote:
>
> Your comment "it perfectly connects" indicates you used ansible -m 
> ping, but the authentication error suggests you did ICMP ping. 
>
> So, which ping did you use? 
>
>
> Thanks 
>
> DIck 
>
>
> On 4 December 2017 at 13:03, Muhammad Mahir  > wrote: 
> >> Thank you so much for your reply. 
> > 
> > 
> > I've got your point and have removed connection: local from my playbook. 
> But 
> > after that a new output appears this time. 
> > 
> > [DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user 
> and 
> > make sure become_method is 'sudo' (default). This feature will be 
> removed in 
> > version 2.6. Deprecation warnings can be disabled by setting 
> > deprecation_warnings=False in ansible.cfg. 
> > 
> > PLAY [Cassandra] 
> > *** 
> > 
> > TASK [Gathering Facts] 
> > * 
> > fatal: [10.0.0.243]: UNREACHABLE! => {"changed": false, "msg": "Failed 
> to 
> > connect to the host via ssh: Permission denied 
> (publickey,password).\r\n", 
> > "unreachable": true} 
> > to retry, use: --limit @/etc/ansible/playbooks/cassandra-playbook.retry 
> > 
> > PLAY RECAP 
> > * 
> > 10.0.0.243 : ok=0changed=0unreachable=1   
>  failed=0 
> > 
> > although when I ping 10.0.0.243 it perfectly connects. what can be the 
> issue 
> > 
> > -- 
> > 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-proje...@googlegroups.com . 
> > To post to this group, send email to ansible...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/346e4fca-e340-486e-9312-45e3e46ef47a%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Dick Visser 
> 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/0a1b534e-686b-45e3-bc13-9c4564f60459%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] delegate_to: localhost and gather_facts: yes playbook still holds previous hosts facts.

2017-12-04 Thread Snehal Biche
Ansible fixed the bug as misunderstood and alsogather_factsa play 
directive, it does not work on tasks.

then whats the way to get localhost facts?


   1. create role and role YML file with remote hosts defined as
   2. create tasks file which actually needs to gather fact of localhost
   3. run the role yml file

role file :- 
-
---
- name: My role name
  hosts: windows
  gather_facts: yes
  vars_files:
- ./roles/myrole/vars/main.yml

  roles:
- { role: myrole,tags: ["myrole"] }


Tasks file :- 

---
#---
  - name: Windows OS User home directory
delegate_to: localhost
gather_facts: true
set_fact:
   userhomedir: '{{ ansible_user_dir }}\.m2'
register: userhomedirwin
when: ansible_os_family == "Windows"
tags:
- winuserhome
  - name: DEBUG Windows OS User home directory
debug:
  var: userhomedirwin
  verbosity: 3
when: ansible_os_family == "Windows"
  - name: Linux OS User home directory
delegate_to: localhost
gather_facts: true
set_fact:
   userhomedir: "{{ ansible_user_dir }}/.m2"
when: ansible_os_family != "Windows"
register: userhomedirlin
tags:
  - linuserhome
  - name: DEBUG Linux OS User home directory
debug:
  var: userhomedirlin
  verbosity: 3
when: ansible_os_family != "Windows"
  - name: Creating Maven settting config file from template
local_action: template src={{ srcSettingsXml }} dest={{ destSettingsXml }}
register: settingxml
tags:
- settingxml
  - name: DEBUG Creating Maven Setting xml config file from template
debug:
  var: settingxml
  verbosity: 3
#---


TASK [cobrowse : Windows OS User home directory] 

task path: /root/svdevops/roles/myrole/tasks/Pre_Setup.yml:57
ok: [192.168.100.222 -> localhost] => {
"ansible_facts": {
"userhomedir": "C:\\Users\\Administrator\\.m2"
},
"changed": false,
"failed": false
}
Read vars_file './roles/myrole/vars/main.yml'

TASK [cobrowse : DEBUG Windows OS User home directory] 
**
task path: /root/svdevops/roles/myrole/tasks/Pre_Setup.yml:66
ok: [192.168.100.222 ] => {
"userhomedirwin": {
"ansible_facts": {
"userhomedir": "C:\\Users\\Administrator\\.m2"
},
"ansible_facts_cacheable": false,
"changed": false,
"failed": false
}
}
Read vars_file './roles/myrole/vars/main.yml'
Read vars_file './roles/myrole/vars/main.yml'

TASK [cobrowse : Linux OS User home directory] 
**
task path: /root/svdevops/roles/myrole/tasks/Pre_Setup.yml:71
skipping: [192.168.100.222 ] => {
"changed": false,
"skip_reason": "Conditional result was False",
"skipped": true
}
Read vars_file './roles/myrole/vars/main.yml'

TASK [cobrowse : DEBUG Linux OS User home directory] 

task path: /root/svdevops/roles/myrole/tasks/Pre_Setup.yml:80
skipping: [192.168.100.222 ] => {
"skip_reason": "Conditional result was False"
}
Read vars_file './roles/myrole/vars/main.yml'
Read vars_file './roles/myrole/vars/main.yml'


-- 
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/6e661848-8750-480b-8426-7bcc264fb475%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to increament a value in file on every run

2017-12-04 Thread Sudip Dutta
Hi all,

The scenario is -

I have a file in which I have below content 

BUILD_VERSION = 4

on every run, I want to increase BUILD_VERSION counter to 1, so that it 
will be -

BUILD_VERSION = 5 (on next run)

I am trying different things but stuck. How can this be done ?


-- 
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/cc2bca0b-c9c1-4b38-98df-1dfc487071ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How to create a big inventpry file in ansible

2017-12-04 Thread Larry Smith
Have you been able to figure this out? I would be glad to help if needed. 
How are you determining which are the masters vs. clients? The first two in 
the list become masters or some other logic?

On Saturday, December 2, 2017 at 2:39:18 AM UTC-5, parwinderjit singh wrote:
>
> Hi Larry,
>
> Can you help me out. I am attaching one excel file and i want to make my 
> host file like below
>
> [cloudera_master]
> orion-RHEL-05ansible_ssh_host=10.48.21.53  host_fqdn=orion-RHEL-05
> orion-RHEL-06ansible_ssh_host=10.48.21.54  host_fqdn=orion-RHEL-06
>
> [cloudera_client]
> orion-RHEL-05ansible_ssh_host=10.48.21.53  host_fqdn=orion-RHEL-05
> orion-RHEL-06ansible_ssh_host=10.48.21.54  host_fqdn=orion-RHEL-06
> orion-RHEL-07ansible_ssh_host=10.48.21.55  host_fqdn=orion-RHEL-07
> orion-RHEL-08ansible_ssh_host=10.48.21.56  host_fqdn=orion-RHEL-08
> orion-RHEL-09ansible_ssh_host=10.48.21.57  host_fqdn=orion-RHEL-09
>
> regards
> parwinder
>
>
> On Sat, Dec 2, 2017 at 10:56 AM, Larry Smith  > wrote:
>
>> Not sure if you figured this out yet or not. But thought I would share 
>> with you how I was able to do this and it works really well. I do not use 
>> the CSV lookup as it didn't seem to work how I needed it to (or I just 
>> couldn't make it work) so I just used the file lookup.
>>
>>
>> https://everythingshouldbevirtual.com/automation/ansible-parsing-csv-list-hosts-ip-hostnames-mac/
>>
>>
>> On Wednesday, November 22, 2017 at 8:52:00 PM UTC-5, parwinderjit singh 
>> wrote:
>>>
>>> Hi All,
>>>
>>>
>>> I have a excel sheet which contain 1000 server hostname  with there IP 
>>> address. I have to create a ansible host file from that sheet. My question 
>>> is, is there a east way to create a ansible host file or i have to manually 
>>> create hostfile for all 100 server ?
>>>
>>>
>>> Thanks & Regards,
>>>
>>> -- 
>> 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/YzQCV3D5ZM4/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> ansible-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d370377e-6f7b-4b5a-8728-1a821f2f7cdd%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/775cf08b-c6fd-4554-b678-90094c8ed330%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Human readable Stdout ansible (2.3.0)

2017-12-04 Thread SUMIT SAHAY
Hi area0,

Thanks for your prompt reply, 

I will tell you what I did, I created callback_plugin directory inside this 
directory I put ansible.cfg file, then I created human_log.py file, now I 
am running my playbook, but I didn't get any output, could you please help 
me to run this playbook.

Looking forward for your reply.

Thanks & Regards
Sumit Sahay


On Monday, 4 December 2017 16:53:45 UTC+5:30, area0 wrote:
>
> just set the following environment variable, no need for the human_log.py 
> callback plugin;
>
> export ANSIBLE_STDOUT_CALLBACK=debug
>
>
> works fine for me; ansible 2.4.0.0
>
>
> Hope this helps
>
> On Monday, December 4, 2017 at 10:08:55 PM UTC+11, SUMIT SAHAY wrote:
>>
>> Hi Rajeev,
>>
>> I have query regarding Callback plugin, could you tell me how to setup 
>> this and how to run this, if you provide the steps it would be much 
>> appreciated.
>>
>>
>> Looking forward for your reply...
>>
>> Thanks & Regards
>> Sumit Sahay
>>
>>
>> On Sunday, 5 March 2017 10:51:27 UTC+5:30, rajeev wrote:
>>>
>>> Sorry for the link not working.. here is the original post which I tried 
>>> to use:
>>>
>>> http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin/
>>>  (it has the two link for 2.x)
>>>
>>> On Sunday, March 5, 2017 at 12:18:24 AM UTC-5, rajeev wrote:

 Thank Dick for your inputs.

 I had no trouble with basic functionality of the tool so far. The only 
 thing is the format of the output.

 Seems you have been working with ansible for sometime, could you please 
 share what are you doing to format the output?
 Is there a better way to handle that in lower version of ansible?

 Thanks again
 Rajeev

 On Saturday, March 4, 2017 at 5:52:09 AM UTC-5, Dick Visser wrote:
>
> On 3 March 2017 at 22:18, rajeev  wrote: 
> > Hello All, 
> > 
> > 
> > I am in need of your urgent help. 
> > I am new to ansible. I have installed the latest version of ansible 
> (2.3.0). 
> > 
> > I need to run the tool across my entire UNIX environment with 1+ 
> hosts. 
> > 
> > 
> > The problem is with the output which is not in a human readable 
> format. I 
> > have created a basic playbook to get some status and have tried both 
> > callback version of the human_log.py listed by Cliff, did not help. 
> > 
> > "For Ansible 2.x, please check out https://gist.github.com/dms... 
> and/or 
> > https://github.com/n0ts/ans...; 
> > 
> > 
> > 
> > Please assist/advise at your earliest, what can I do to make the 
> output more 
> > readable. 
>
>
> You are running an unreleased version of a tool you don't have 
> experience with on 1+ hosts? Em... OK. 
> First try picking a released version and see what that does. 
> As for the rest, none of the URLs you posted actually work. 
> So we're left with Googling for some terms. 
> Apparently (still guessing here) you mean this plugin: 
>
> http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin/
>  
> You already asked the author of the plugin, and seem to have verbatim 
> pasted the (HTML) answer here - including the obfuscated URLs. 
> One leads to a fork (https://github.com/n0ts/ansible-human_log), the 
> other one to a gist 
> (https://gist.github.com/dmsimard/cd706de198c85a8255f6). 
> Since these are specific plugins and not part of Ansible, I think your 
> best bet is to ask the authors (again) for advice. 
> I can already see some hints that they work with older versions. 
> That might or might not be usable in your situation - hard to tell 
> with the current amount of information. 
>
>
>
> Dick 
>
>
>
>
>
> -- 
> 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/881e2e3a-27df-4a4a-bf2b-43df196f0acf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Wont be able to ping Windows Machines Via Linux Ansible Server

2017-12-04 Thread shilpa motghare
Thanks

It works, I am able to do ping pong to my windows client but not able to
install a .exe packages through ansible this is my output

ansible windows  -m win_ping
Lenovo-PC | SUCCESS => {
"changed": false,
"ping": "pong"
}

And my windows.yml file is:
ansible_user: Administrator
ansible_password: 
ansible_ssh_port: 5985
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore

but now I want to install a notepad++  on windows via ansible this is my
notepad.yml file:

- name: test raw module
  hosts: windows
  tasks:
- name: Install Notepad plus
  win_package:
path: C:\tmp\notepad.exe
product_id:
state: present
It take too much time for the output and it come  with error the screenshot
of error I am attaching here.

Please help me why this happening.

On Thu, Nov 23, 2017 at 12:26 PM, Soniya panwar 
wrote:

> Hello,
>
> There could be a few things not correctly configured or missed that could
> result into below error:
>
>
> First and foremost, while installing Ansible, did you resolve dependencies
> for paramiko, PyYAML, Jinja2 and httplib2 packages? If not, you may execute
> below commands on the linux machine with Ansible installation.
>
> 1.   $ sudo pip install paramiko PyYAML Jinja2 httplib2
>
> 2.   $ pip install "pywinrm>=0.1.1"
>
> 3.   $ pip install http://github.com/diyan/pywinrm/archive/master.zip#
> egg=pywinrm
>
>
>
> Secondly, verify that the version of Microsoft.NET Framework is 4.0 or
> later. If not you may follow below steps to get it upgraded.
>
> 1.   Click on Start -> Control Panel -> Program and Features -> Add
> or Remove Programs.
>
> 2.   Scroll down to the M's and look for Microsoft .NET Framework.
> If you don't have version 4.0 or later, download and install it from here “
> https://www.microsoft.com/en-us/download/details.aspx?id=30653”.
>
>
>
> Thirdly, the ansible_user used in windows.yml file should have admin
> privileges on remote windows machine to make connection to PowerShell. You
> may follow below steps to grant admin privileges to the user, if not
> provided already.
>
> 1.   Click on Start -> Control Panel -> User Accounts -> Manage User
> Accounts.
>
> 2.   Select your new account and click on Properties.
>
> 3.   Click on the Group Membership tab and change the Group
> Membership from Standard User to Administrator.
>
> 4.   Click OK, OK and Close.  Restart computer.
>
> *Note*:- The remote computer need not be logged into this account for
> Ansible to make a remote connection to PowerShell, but the account must
> exist.
>
>
>
> Last but not the least, you need to execute a PowerShell script in order
> to enable WinRM/PS Remoting. Below are the steps to be followed.
>
> 1.   Start PowerShell and run the command Set-ExecutionPolicy
> -ExecutionPolicy Unrestricted
>
> 2.   Download PowerShell script (named ConfigureRemotingForAnsible.ps1)
> for enabling WinRM/PSRemoting.  You can get the most recent version here:
> “https://github.com/ansible/ansible/blob/devel/examples/scripts/
> ConfigureRemotingForAnsible.ps1”.
>
> 3.   And then run the PowerShell script :
>
> •  powershell.exe -File ConfigureRemotingForAnsible.ps1
>
>
>   Pass the -CertValidityDays option to customize the
> expiration date of the generated certificate:
>
> •  powershell.exe -File ConfigureRemotingForAnsible.ps1
> -CertValidityDays 100
>
>  Pass the -EnableCredSSP switch to enable CredSSP as an
> authentication option:
>
>• powershell.exe -File ConfigureRemotingForAnsible.ps1
> –EnableCredSSP
>
>  Pass the -ForceNewSSLCert switch to force a new SSL
> certificate to be attached to an already existing winrm listener.
>
>• powershell.exe -File ConfigureRemotingForAnsible.ps1
> –ForceNewSSLCert
>
> Pass the -SkipNetworkProfileCheck switch to configure winrm to
> listen on PUBLIC zone interfaces.
>
>   • powershell.exe -File ConfigureRemotingForAnsible.ps1
> –SkipNetworkProfileCheck
>
> Additionally the -Verbose option can be used to get more
> information on screen about what it is doing
>
>   • powershell.exe -File ConfigureRemotingForAnsible.ps1
> –Verbose
>
>
>
> Output of this command should be like this:
>
> VERBOSE: Verifying WinRM service.
>
> VERBOSE: PS Remoting is already enabled.
>
> VERBOSE: SSL listener is already active.
>
> VERBOSE: Basic auth is already enabled.
>
> VERBOSE: Firewall rule already exists to allow WinRM HTTPS.
>
> VERBOSE: HTTP: Enabled | HTTPS: Enabled
>
> VERBOSE: PS Remoting has been successfully configured for Ansible.
>
>
>
> 4.  Run the PowerShell command Set-ExecutionPolicy
> -ExecutionPolicy Restricted.
>
> 5.  Close PowerShell.
>
> If all of the above steps are performed correctly, you should get a
> successful ping-pong 

Re: [ansible-project] using tests to match a hostname

2017-12-04 Thread Pshem Kowalczyk
The match is a regular expression match (not a wildcard match). If you want
something ending in 'd' try this:

search('d$')

kind regards
Pshem


On Tue, 5 Dec 2017 at 13:08 Luke Miller  wrote:

>
> I am trying to use tests to match a hostname, I want hostnames that end in
> the letter "d", they are non-production hosts, here is what I have:
>
> - name: Register to Foreman Redhat non-Prod
>   redhat_subscription:
> state: present
> activationkey: "Non-Prod-Redhat-7"
> org_id: "Default_Organization"
>   when: inventory_hostname_short | match("*d")
>
>
> and I am getting this error:
>
> TASK [Register to Foreman Redhat non-Prod]
> ***
> fatal: [slpatch001d]: FAILED! => {"failed": true, "msg": "The conditional
> check 'inventory_hostname_short | match(\"*d\")' failed. The error was:
> nothing to repeat\n\nThe error appears to have been in
> '/Users/millerlu/misc/foreman.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\n- name: Register to Foreman Redhat
> non-Prod\n  ^ here\n"}
>
> What am I doing wrong here?
>
> Thanks,
> Luke
>
> --
> 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/b1b87d02-ac11-4fca-95ce-9cbd2ee59729%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/CAEaZiRVXV_3mGu55Ht%2BVUbwC-QyeER3Ze3tq_GKb6fA5Ev-piQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] using tests to match a hostname

2017-12-04 Thread Luke Miller

I am trying to use tests to match a hostname, I want hostnames that end in 
the letter "d", they are non-production hosts, here is what I have:

- name: Register to Foreman Redhat non-Prod
  redhat_subscription:
state: present
activationkey: "Non-Prod-Redhat-7"
org_id: "Default_Organization"
  when: inventory_hostname_short | match("*d")


and I am getting this error:

TASK [Register to Foreman Redhat non-Prod] 
***
fatal: [slpatch001d]: FAILED! => {"failed": true, "msg": "The conditional 
check 'inventory_hostname_short | match(\"*d\")' failed. The error was: 
nothing to repeat\n\nThe error appears to have been in 
'/Users/millerlu/misc/foreman.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\n- name: Register to Foreman Redhat 
non-Prod\n  ^ here\n"}

What am I doing wrong here? 

Thanks,
Luke

-- 
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/b1b87d02-ac11-4fca-95ce-9cbd2ee59729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Hide with_dict variables from playbook output

2017-12-04 Thread texas living
I have a playbook where I use a dictionary variable file and an 
includes_tasks play. My issue is the playbook displays the variables when 
it is run. I tried no_log: True and ignore_errors: True but makes no 
difference. I am using ansible version 2.4.1.0

*Here is the playbook tasks:*

tasks:
  - name: "Install License and Remove Default Identifier"
include_tasks: includes/junos_license.yml
with_dict: "{{ vsrx  }}"

*Here is the output from running the playbook:*

TASK [Install License and Remove Default Identifier] 
***

msg: All items completed

results: [
  {
"item": {
  "key": "vsrx-02", 
  "value": {
"Hostname": "vsrx-02", 
"IP_Address": "192.168.1.211"
  }
}, 
"_ansible_item_result": true, 
"include": "includes/junos_license.yml", 
"include_variables": {}
  }, 
  {
"item": {
  "key": "vsrx-01", 
  "value": {
"Hostname": "vsrx-01", 
"IP_Address": "192.168.1.209"
  }
}, 
"_ansible_item_result": true, 
"include": "includes/junos_license.yml", 
"include_variables": {}
  }
] 
included: /home/ansible/junos_base_config/includes/junos_license.yml for 
localhost
included: /home/ansible/junos_base_config/includes/junos_license.yml for 
localhost

-- 
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/b29a46e9-97c4-4c20-8379-dddc1944d3b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Error when running included playbook

2017-12-04 Thread Larry Bakun
Hi everyone,
I'm receiving this weird error when running the second playbook (with 
include module and passing IP address).
Here is my first playbook:

---
- name: get VM list from ESXi
  hosts: all

  tasks:
  - name: get facts
vmware_vm_facts:
  hostname: "{{ inventory_hostname }}"
  username: "{{ ansible_ssh_user }}"
  password: "{{ ansible_ssh_pass }}"
delegate_to: localhost
register: esx_facts

  - name: < {

"msg": "Received IP: 192.168.1.59"

}


TASK [< ESTABLISH LOCAL CONNECTION FOR USER: root

 EXEC /bin/sh -c 'echo ~ && sleep 0'

 EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886 `" && echo 
ansible-tmp-1512415750.71-126408181937886="` echo 
/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886 `" ) && sleep 
0'

 PUT /tmp/tmp8miEQJ TO 
/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886/vmware_vm_facts.py

 EXEC /bin/sh -c 'chmod u+x 
/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886/ 
/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886/vmware_vm_facts.py 
&& sleep 0'

 EXEC /bin/sh -c '/usr/bin/python2 
/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886/vmware_vm_facts.py;
 
rm -rf "/root/.ansible/tmp/ansible-tmp-1512415750.71-126408181937886/" > 
/dev/null 2>&1 && sleep 0'

fatal: [192.168.1.55 -> localhost]: FAILED! => {

"changed": false, 

"failed": true, 

"invocation": {

"module_args": {

"hostname": "192.168.1.59", 

"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 

"username": "root", 

"validate_certs": false

}

}, 

"msg": "[Errno 111] Connection refused"

}


 Anybody has any idea?

Thanks,
Larry


-- 
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/fe3308a3-b374-4dc1-ae0c-ddd7d1ab9a8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] I cant create a simple .txt file using ansible.

2017-12-04 Thread Dick Visser
Your comment "it perfectly connects" indicates you used ansible -m
ping, but the authentication error suggests you did ICMP ping.

So, which ping did you use?


Thanks

DIck


On 4 December 2017 at 13:03, Muhammad Mahir  wrote:
>> Thank you so much for your reply.
>
>
> I've got your point and have removed connection: local from my playbook. But
> after that a new output appears this time.
>
> [DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and
> make sure become_method is 'sudo' (default). This feature will be removed in
> version 2.6. Deprecation warnings can be disabled by setting
> deprecation_warnings=False in ansible.cfg.
>
> PLAY [Cassandra]
> ***
>
> TASK [Gathering Facts]
> *
> fatal: [10.0.0.243]: UNREACHABLE! => {"changed": false, "msg": "Failed to
> connect to the host via ssh: Permission denied (publickey,password).\r\n",
> "unreachable": true}
> to retry, use: --limit @/etc/ansible/playbooks/cassandra-playbook.retry
>
> PLAY RECAP
> *
> 10.0.0.243 : ok=0changed=0unreachable=1failed=0
>
> although when I ping 10.0.0.243 it perfectly connects. what can be the issue
>
> --
> 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/346e4fca-e340-486e-9312-45e3e46ef47a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Dick Visser
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/CAL8fbwOAAQ4d4%2B4qJq94jqbdGuzK2V3k_Ga0sThHe3%2BpGgKR7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Wont be able to ping Windows Machines Via Linux Ansible Server

2017-12-04 Thread Selva Kumar
I also hitting same issue. My /etc/ansible/hosts entry:

[windows]
10.x.x.33

cat /etc/ansible/groups_vars/windows.yml

ansible_user: Administrator
ansible_password: 
ansible_port: 5986
ansible_connection: winrm
# The following is necessary for Python 2.7.9+ when using default WinRM 
self-signed certificates:
ansible_winrm_server_cert_validation: ignore

When I do ansible windows -m win_ping, getting below error:

10.x.x.33 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 
10.x.x7.33 port 22: Connection timed out\r\n",
"unreachable": true
}

10.x.x.33 is a windows host and not sure why complaining about ssh error.

I did check and confirm the steps mentioned by Sonia and Jon, but still nu 
luck. Please help.





On Sunday, November 26, 2017 at 11:23:44 PM UTC+5:30, J Hawkesworth wrote:
>
> Hey I think you have the settings right, you just need to move
> /etc/ansible/windows.yml to /etc/ansible/group_vars/windows.yml
>
> You have created the group called windows in your inventory
> [windows]
> Lenovo-PC
>
> But the group variables aren't taking effect because they aren't in the 
> location ansible expects (in group_vars/.yml in sub dir 
> under the dir where your inventory file is.
>
> I think if you move the file it will all start working.
>
> Hope this helps,
>
> Jon
>
>
> On Thursday, November 23, 2017 at 6:56:05 AM UTC, Soniya panwar wrote:
>>
>> Hello,
>>
>> There could be a few things not correctly configured or missed that could 
>> result into below error:
>>
>>
>> First and foremost, while installing Ansible, did you resolve 
>> dependencies for paramiko, PyYAML, Jinja2 and httplib2 packages? If not, 
>> you may execute below commands on the linux machine with Ansible 
>> installation.
>>
>> 1.   $ sudo pip install paramiko PyYAML Jinja2 httplib2
>>
>> 2.   $ pip install "pywinrm>=0.1.1"
>>
>> 3.   $ pip install 
>> http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
>>
>>  
>>
>> Secondly, verify that the version of Microsoft.NET Framework is 4.0 or 
>> later. If not you may follow below steps to get it upgraded.
>>
>> 1.   Click on Start -> Control Panel -> Program and Features -> Add 
>> or Remove Programs.  
>>
>> 2.   Scroll down to the M's and look for Microsoft .NET Framework.  
>> If you don't have version 4.0 or later, download and install it from here “
>> https://www.microsoft.com/en-us/download/details.aspx?id=30653”.
>>
>>  
>>
>> Thirdly, the ansible_user used in windows.yml file should have admin 
>> privileges on remote windows machine to make connection to PowerShell. You 
>> may follow below steps to grant admin privileges to the user, if not 
>> provided already.
>>
>> 1.   Click on Start -> Control Panel -> User Accounts -> Manage User 
>> Accounts. 
>>
>> 2.   Select your new account and click on Properties.  
>>
>> 3.   Click on the Group Membership tab and change the Group 
>> Membership from Standard User to Administrator.  
>>
>> 4.   Click OK, OK and Close.  Restart computer.  
>>
>> *Note*:- The remote computer need not be logged into this account for 
>> Ansible to make a remote connection to PowerShell, but the account must 
>> exist.
>>
>>  
>>
>> Last but not the least, you need to execute a PowerShell script in order 
>> to enable WinRM/PS Remoting. Below are the steps to be followed. 
>>
>> 1.   Start PowerShell and run the command Set-ExecutionPolicy  
>> -ExecutionPolicy Unrestricted 
>>
>> 2.   Download PowerShell script (named 
>> ConfigureRemotingForAnsible.ps1) for enabling WinRM/PSRemoting.  You can 
>> get the most recent version here:
>> “
>> https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1”.
>>   
>>
>>
>> 3.   And then run the PowerShell script :
>>
>> •  powershell.exe -File 
>> ConfigureRemotingForAnsible.ps1 
>>
>>   Pass the -CertValidityDays option to customize the 
>> expiration date of the generated certificate:
>>
>> •  powershell.exe -File 
>> ConfigureRemotingForAnsible.ps1 -CertValidityDays 100
>>
>>  Pass the -EnableCredSSP switch to enable CredSSP as an 
>> authentication option:
>>
>>• powershell.exe -File ConfigureRemotingForAnsible.ps1 
>> –EnableCredSSP
>>
>>  Pass the -ForceNewSSLCert switch to force a new SSL 
>> certificate to be attached to an already existing winrm listener.
>>
>>• powershell.exe -File ConfigureRemotingForAnsible.ps1 
>> –ForceNewSSLCert
>>
>> Pass the -SkipNetworkProfileCheck switch to configure winrm 
>> to listen on PUBLIC zone interfaces.
>>
>>   • powershell.exe -File ConfigureRemotingForAnsible.ps1 
>> –SkipNetworkProfileCheck
>>
>> Additionally the -Verbose option can be used to get more 
>> information on screen about what it is doing
>>
>>   • powershell.exe -File 

[ansible-project] Upgrading a list of packages from local .deb files

2017-12-04 Thread Andrey Agenosov
Hello, I have the issue with upgrading our product on Debian-based systems.

We have already installed packages of the version, for example, 2.0. There 
are several packages and some of it depend of the other. 

When I'm trying to **upgrade the product** from the version 2.0 to the 
version 2.1, **passing a list of .deb packages, the error occurs because of 
an unresolved dependency**.

Below there is a *yml*-fragment to illustrate what I do:

- name: Installing packages [apt]
apt:
  deb="{{ packages_to_install }}"
  state=present
  update_cache=yes
when: ansible_pkg_mgr == "apt"

I tried to find out what's going on under the hood by debugging the 
Ansible's apt module:

 - when iterating over the list of .deb files, for each file there is a 
check of the package's version with version of the already installed 
package with the same name
 - if versions are differ, there is a call to the 
*apt.debfile.DebPackage.check()* function, which in my case returns false 
(this is due to the fact that in case of installing a newer version of a 
package there will be a dependency conflict for another package, which is 
also part of our product).

**In case of yum, this case passes successfully** - the Ansible's yum 
module supports **thansactional update from local .rpm files**.

What will be the right solution for Debian? 
Perform full deinstallation of the product before installing the new 
version? Or should I patch the Ansible's apt module?

-- 
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/2fd74d8e-d1b0-4a65-8070-5ba6e1af63e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] I cant create a simple .txt file using ansible.

2017-12-04 Thread Muhammad Mahir

>
> Thank you so much for your reply.


I've got your point and have removed connection: local from my playbook. 
But after that a new output appears this time.

[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user 
and 
make sure become_method is 'sudo' (default). This feature will be removed 
in 
version 2.6. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

PLAY [Cassandra] 
***

TASK [Gathering Facts] 
*
fatal: [10.0.0.243]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
connect to the host via ssh: Permission denied (publickey,password).\r\n", 
"unreachable": true}
to retry, use: --limit @/etc/ansible/playbooks/cassandra-playbook.retry

PLAY RECAP 
*
10.0.0.243 : ok=0changed=0unreachable=1failed=0 

although when I ping 10.0.0.243 it perfectly connects. what can be the issue

-- 
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/346e4fca-e340-486e-9312-45e3e46ef47a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Galaxy web site maintenance - 4 December 2017 @ 6:00 AM Eastern

2017-12-04 Thread chousekn
Maintenance completed. Galaxy 2.4.0 was successfully deployed. 

Thanks!


On Friday, December 1, 2017 at 9:42:58 AM UTC-5, chou...@redhat.com wrote:
>
> We'll be doing some minor maintenance to the Galaxy web site on 4-Dec-2017 
> between 6:00 AM and 7:00 AM Eastern.
>
> Be aware that during this window it is possible that role imports and 
> downloads may be interrupted.
>
> We'll do our best to have the site back online before 7:00 AM. Check the 
> mailing list for updates. 
>
> Thanks!
>
> Chris Houseknecht
> Principal Engineer
> Red Hat
>
>

-- 
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/92208c31-3f1f-46b5-9755-c9ddbe762084%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Human readable Stdout ansible (2.3.0)

2017-12-04 Thread area0
just set the following environment variable, no need for the human_log.py 
callback plugin;

export ANSIBLE_STDOUT_CALLBACK=debug


works fine for me; ansible 2.4.0.0


Hope this helps

On Monday, December 4, 2017 at 10:08:55 PM UTC+11, SUMIT SAHAY wrote:
>
> Hi Rajeev,
>
> I have query regarding Callback plugin, could you tell me how to setup 
> this and how to run this, if you provide the steps it would be much 
> appreciated.
>
>
> Looking forward for your reply...
>
> Thanks & Regards
> Sumit Sahay
>
>
> On Sunday, 5 March 2017 10:51:27 UTC+5:30, rajeev wrote:
>>
>> Sorry for the link not working.. here is the original post which I tried 
>> to use:
>>
>> http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin/
>>  (it has the two link for 2.x)
>>
>> On Sunday, March 5, 2017 at 12:18:24 AM UTC-5, rajeev wrote:
>>>
>>> Thank Dick for your inputs.
>>>
>>> I had no trouble with basic functionality of the tool so far. The only 
>>> thing is the format of the output.
>>>
>>> Seems you have been working with ansible for sometime, could you please 
>>> share what are you doing to format the output?
>>> Is there a better way to handle that in lower version of ansible?
>>>
>>> Thanks again
>>> Rajeev
>>>
>>> On Saturday, March 4, 2017 at 5:52:09 AM UTC-5, Dick Visser wrote:

 On 3 March 2017 at 22:18, rajeev  wrote: 
 > Hello All, 
 > 
 > 
 > I am in need of your urgent help. 
 > I am new to ansible. I have installed the latest version of ansible 
 (2.3.0). 
 > 
 > I need to run the tool across my entire UNIX environment with 1+ 
 hosts. 
 > 
 > 
 > The problem is with the output which is not in a human readable 
 format. I 
 > have created a basic playbook to get some status and have tried both 
 > callback version of the human_log.py listed by Cliff, did not help. 
 > 
 > "For Ansible 2.x, please check out https://gist.github.com/dms... 
 and/or 
 > https://github.com/n0ts/ans...; 
 > 
 > 
 > 
 > Please assist/advise at your earliest, what can I do to make the 
 output more 
 > readable. 


 You are running an unreleased version of a tool you don't have 
 experience with on 1+ hosts? Em... OK. 
 First try picking a released version and see what that does. 
 As for the rest, none of the URLs you posted actually work. 
 So we're left with Googling for some terms. 
 Apparently (still guessing here) you mean this plugin: 

 http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin/
  
 You already asked the author of the plugin, and seem to have verbatim 
 pasted the (HTML) answer here - including the obfuscated URLs. 
 One leads to a fork (https://github.com/n0ts/ansible-human_log), the 
 other one to a gist 
 (https://gist.github.com/dmsimard/cd706de198c85a8255f6). 
 Since these are specific plugins and not part of Ansible, I think your 
 best bet is to ask the authors (again) for advice. 
 I can already see some hints that they work with older versions. 
 That might or might not be usable in your situation - hard to tell 
 with the current amount of information. 



 Dick 





 -- 
 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/50175894-c2e4-4328-84c2-f3bce219907b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Human readable Stdout ansible (2.3.0)

2017-12-04 Thread SUMIT SAHAY
Hi Rajeev,

I have query regarding Callback plugin, could you tell me how to setup this 
and how to run this, if you provide the steps it would be much appreciated.


Looking forward for your reply...

Thanks & Regards
Sumit Sahay


On Sunday, 5 March 2017 10:51:27 UTC+5:30, rajeev wrote:
>
> Sorry for the link not working.. here is the original post which I tried 
> to use:
>
> http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin/
>  (it has the two link for 2.x)
>
> On Sunday, March 5, 2017 at 12:18:24 AM UTC-5, rajeev wrote:
>>
>> Thank Dick for your inputs.
>>
>> I had no trouble with basic functionality of the tool so far. The only 
>> thing is the format of the output.
>>
>> Seems you have been working with ansible for sometime, could you please 
>> share what are you doing to format the output?
>> Is there a better way to handle that in lower version of ansible?
>>
>> Thanks again
>> Rajeev
>>
>> On Saturday, March 4, 2017 at 5:52:09 AM UTC-5, Dick Visser wrote:
>>>
>>> On 3 March 2017 at 22:18, rajeev  wrote: 
>>> > Hello All, 
>>> > 
>>> > 
>>> > I am in need of your urgent help. 
>>> > I am new to ansible. I have installed the latest version of ansible 
>>> (2.3.0). 
>>> > 
>>> > I need to run the tool across my entire UNIX environment with 1+ 
>>> hosts. 
>>> > 
>>> > 
>>> > The problem is with the output which is not in a human readable 
>>> format. I 
>>> > have created a basic playbook to get some status and have tried both 
>>> > callback version of the human_log.py listed by Cliff, did not help. 
>>> > 
>>> > "For Ansible 2.x, please check out https://gist.github.com/dms... 
>>> and/or 
>>> > https://github.com/n0ts/ans...; 
>>> > 
>>> > 
>>> > 
>>> > Please assist/advise at your earliest, what can I do to make the 
>>> output more 
>>> > readable. 
>>>
>>>
>>> You are running an unreleased version of a tool you don't have 
>>> experience with on 1+ hosts? Em... OK. 
>>> First try picking a released version and see what that does. 
>>> As for the rest, none of the URLs you posted actually work. 
>>> So we're left with Googling for some terms. 
>>> Apparently (still guessing here) you mean this plugin: 
>>>
>>> http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin/
>>>  
>>> You already asked the author of the plugin, and seem to have verbatim 
>>> pasted the (HTML) answer here - including the obfuscated URLs. 
>>> One leads to a fork (https://github.com/n0ts/ansible-human_log), the 
>>> other one to a gist 
>>> (https://gist.github.com/dmsimard/cd706de198c85a8255f6). 
>>> Since these are specific plugins and not part of Ansible, I think your 
>>> best bet is to ask the authors (again) for advice. 
>>> I can already see some hints that they work with older versions. 
>>> That might or might not be usable in your situation - hard to tell 
>>> with the current amount of information. 
>>>
>>>
>>>
>>> Dick 
>>>
>>>
>>>
>>>
>>>
>>> -- 
>>> 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/dfd70116-7450-419e-86df-76580c31465e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] I cant create a simple .txt file using ansible.

2017-12-04 Thread Kai Stian Olstad

On 04.12.2017 09:38, Muhammad Mahir wrote:

Hello there,

I just want to test my script if it creates a simple .txt file into a
destination put instead it is creating that same file into the source
vm that is where the ansible is installed.

Here is the simple script I'm running.

---

*- hosts: Cassandra*
*  remote_user: murtaza*
*  connection: local*


That's because of the connection line
http://docs.ansible.com/ansible/latest/playbooks_delegation.html#local-playbooks


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


[ansible-project] I cant create a simple .txt file using ansible.

2017-12-04 Thread Muhammad Mahir
Hello there,

I just want to test my script if it creates a simple .txt file into a 
destination put instead it is creating that same file into the source 
vm that is where the ansible is installed. 

Here is the simple script I'm running.

---

*- hosts: Cassandra*
*  remote_user: murtaza*
*  connection: local*
*  sudo: yes*
*  tasks:*
*   - name: Create an empty file with name myfile.txt*
* shell: touch myfile.txt state=touch*

Output :-

*[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user 
and *
*make sure become_method is 'sudo' (default). This feature will be removed 
in *
*version 2.6. Deprecation warnings can be disabled by setting *
*deprecation_warnings=False in ansible.cfg.*

*PLAY [Cassandra] 


*TASK [Gathering Facts] 
**
*ok: [10.0.0.243]*

*TASK [Create an empty file with name myfile.txt] 

* [WARNING]: Consider using file module with state=touch rather than 
running*
*touch*

*changed: [10.0.0.243]*

*PLAY RECAP 
**
*10.0.0.243 : ok=2changed=1unreachable=0
failed=0  *

This shows that it is creating and doing the job all right. But still when 
I ssh into 10.0.0.243 it doesnt create any .txt file with this name but 
instead creates the file into the source where the ansilbe is installed.

Please have a look into this issue

-- 
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/2c7239df-cf23-4ddb-a9b6-e32769a6c6c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.