Re: [ansible-project] Re: error while deploying docker-ce using ansible

2020-02-03 Thread Dick Visser
This is some local yum networking issue, not an ansible related issue.

On Mon, 3 Feb 2020 at 20:13, João Santos  wrote:
>
> troubleshoot 101...
> You can see several keywords, yum, load balancers, and redhat link stuff...
>
> ssh to machine and check if you are able to execute your specific task/action?
>
>
>
> On Monday, 3 February 2020 17:51:54 UTC, Vishal Bobade wrote:
>>
>> Hi,
>>
>>
>> I am facing below error while running ansible role in my environment. could 
>> some one quide me how can I fix this.
>>
>> TASK [docker_base : Install docker-ce] 
>> *
>>
>>  [0;31mfatal: [10.181.56.199]: FAILED! => {"changed": false, "msg": "Failure 
>> talking to yum: Could not contact any CDS load balancers: 
>> rhui2-cds01.us-east-1.aws.ce.redhat.com, 
>> rhui2-cds02.us-east-1.aws.ce.redhat.com."} [0m
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/23eb3b0e-0a80-4e3a-a759-fc0bd7f9701e%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwNYbeasubVhw0hpHL5gayLehZ%3DiRq2QQv0CHEUzk7aQaQ%40mail.gmail.com.


Re: [ansible-project] Error while readin split part for updating Ubuntu packages - Should I include the path of splitpath,py in playbook ?

2020-02-03 Thread Dick Visser
Hii

"splitpath.py" isn't a valid key for the config file. The correct one
is "filter_plugins", see:
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-filter-plugin-path

But I don't see why you would need such heavy weapons if all you want
is a list of package names that have pending updates.
This should roughly do the same, without the complexity of custom filters:


- name: Check for pending updates
  become: true
  hosts: all

  tasks:
- name: Update cache
  apt:
update-cache: yes
  changed_when: false

- name: Fetch package list of updates
  command: apt list --upgradable
  register: aptlist

- set_fact:
updates: "{{ aptlist.stdout_lines | difference(['Listing...'])
| map('regex_replace', '^(.*?)\/(.*)', '\\1') | list }}"

- debug: var=updates


On Tue, 4 Feb 2020 at 01:12, Work-Hard  wrote:
>
> Hello, Please see below
> ansible.cfg
> [defaults]
> inventory = ./hosts
>
> splitpart.py = /etc/ansible/splitpart.py/
>
> splitpart.py
> def splitpart (value, index, char = ','):
> if isinstance(value, (list, tuple)):
> ret = []
> for v in value:
> ret.append(v.split(char)[index])
> return ret
> else:
> return value.split(char)[index]
>
> class FilterModule(object):
> def filters(self):
> return {'splitpart': splitpart
>
>
> playbook
>   tasks:
> # do an "apt-get update", to ensure latest package lists
> - name: apt-get update
>   apt:
> update-cache: yes
>   changed_when: 0
>
> # get a list of packages that have updates
> - name: get list of pending upgrades
>   command: apt-get --simulate dist-upgrade
>   args:
> warn: false # don't warn us about apt having its own plugin
>   register: apt_simulate
>   changed_when: 0
>
> # pick out list of pending updates from command output. This essentially
> # takes the above output from "apt-get --simulate dist-upgrade", and
> # pipes it through "cut -f2 -d' ' | sort"
> - name: parse apt-get output to get list of changed packages
>   set_fact:
> updates: '{{ apt_simulate.stdout_lines | select("match", "^Inst ") | 
> list | splitpart(1, " ") | list | sort }}'
>   changed_when: 0
>
> # tell user about packages being updated
> - name: show pending updates
>   debug:
> var: updates
>   when: updates.0 is defined
>
>
> playbook output
>
> PLAY [myotherserver] 
> *
>
> TASK [Gathering Facts] 
> ***
> ok: [10.0.2.236]
>
> TASK [apt-get update] 
> 
> ok: [10.0.2.236]
>
> TASK [get list of pending upgrades] 
> **
> ok: [10.0.2.236]
>
> TASK [parse apt-get output to get list of changed packages] 
> **
> fatal: [10.0.2.236]: FAILED! => {"msg": "template error while templating 
> string: no filter named 'splitpart'. String: {{ apt_simulate.stdout_lines | 
> select(\"match\", \"^Inst \") | list | splitpart(1, \" \") | list | sort }}"}
>
> PLAY RECAP 
> ***
> 10.0.2.236 : ok=3changed=0unreachable=0failed=1   
>  skipped=0rescued=0ignored=0
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/9de09a5f-1173-43b7-a2d7-3332ba0e060d%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPP-nRd%3DmngXwsmhgqcrPkfmPbaDoDCJvamwwy23uA34g%40mail.gmail.com.


[ansible-project] multi process

2020-02-03 Thread Mark Anthony Garcia
has anyone tried multi process / multi threading in ansible?  not sure if
my term is correct, but this is available in Python and was wondering if
anyone was able to apply the same in Ansible.

thank you.

Mark

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGFwMxp_vWO7ZWi3N-_8LvOFKH9WTAsz%3DUhutLKh3NZRkaJ-0Q%40mail.gmail.com.


[ansible-project] Selenium Script to be trigger from ansible Playbook

2020-02-03 Thread Manish Kumar
Dear All,

I am trying to automate selenium script for web browser testing which will 
be trigger by ansible playbook once configuration is done.

Please share if you have any sample playbook which can be modified and used 
for the same or any idea you would like to share .

Thanks,
Manish

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fee64673-82ef-4e22-9aa0-ee6ad1011ebf%40googlegroups.com.


Re: [ansible-project] start servers using ansible playbook

2020-02-03 Thread James Cassell
On Tue, Feb 4, 2020, at 12:03 AM, James Cassell wrote:
> On Mon, Feb 3, 2020, at 8:56 PM, Cloud09 wrote:
> > Hello Team,
> > 
> > I am writing a playbook to start weblogic servers, could anyone help me 
> > any syntax errors, I could not make item/item display as it should be, 
> > or please feel free to correct me here if any incorrect syntax and 
> > would not work as expected.
> > 
> > ---
> >  - hosts: appservers
> > become: yes
> > become_user: cloud9
> > vars:
> > filepath:
> >  - "nohup /opt/jpmc/cloud9/stat/wl12213/cloud9/bin"
> > stopservers:
> >  - "/stop-caServer01.sh"
> >  - "/stop-nyServer01.sh"
> >  - "/stop-ohServer01.sh"
> > tasks:
> >  - name: Start the admin server
> > command: "{{item}}/startManagedWebLogic.sh"
> > loop:
> >  - filepath 
> >  - name: Start the managed server(s)
> > command: "{{item}}/{{item}}"
> > loop: 
> >  - filepath
> >  - stopservers
> 
> Instead of loop, I'd recommend with_together.
> 
> - name: Start the managed server(s)
>  command: "{{item.0}}/{{item.1}}"
>  with_together: 
>   - "{{filepath}}"
>   - "{{stopservers}}"
> 

Actually it's much simpler for your example:


- name: Start the managed server(s)
 command: "{{filepath}}/{{item}}"
 loop: "{{stopservers}}"

V/r,
James Cassell

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ebfb0e3c-b7e5-42c7-a4a4-aaa20c9c85ff%40www.fastmail.com.


Re: [ansible-project] start servers using ansible playbook

2020-02-03 Thread James Cassell
On Mon, Feb 3, 2020, at 8:56 PM, Cloud09 wrote:
> Hello Team,
> 
> I am writing a playbook to start weblogic servers, could anyone help me 
> any syntax errors, I could not make item/item display as it should be, 
> or please feel free to correct me here if any incorrect syntax and 
> would not work as expected.
> 
> ---
>  - hosts: appservers
> become: yes
> become_user: cloud9
> vars:
> filepath:
>  - "nohup /opt/jpmc/cloud9/stat/wl12213/cloud9/bin"
> stopservers:
>  - "/stop-caServer01.sh"
>  - "/stop-nyServer01.sh"
>  - "/stop-ohServer01.sh"
> tasks:
>  - name: Start the admin server
> command: "{{item}}/startManagedWebLogic.sh"
> loop:
>  - filepath 
>  - name: Start the managed server(s)
> command: "{{item}}/{{item}}"
> loop: 
>  - filepath
>  - stopservers

Instead of loop, I'd recommend with_together.

- name: Start the managed server(s)
 command: "{{item.0}}/{{item.1}}"
 with_together: 
  - "{{filepath}}"
  - "{{stopservers}}"

V/r,
James Cassell

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80545ac9-2517-41d8-a9cf-96339c5ff105%40www.fastmail.com.


Re: [ansible-project] How to do 3 with_items in the same task ?

2020-02-03 Thread Vladimir Botka
On Mon, 3 Feb 2020 16:31:21 -0800 (PST)
Anand Solomon  wrote:

> variablefile.yml
> 
> var1:
>  - first_value1
>  - first_value2
> var2:
>  - second_value1
>  - second_value2
> var3:
>  - third_value1
>  - third_value2 
> 
> I want to read the value from the text file and pass that as a variable in 
> loop. 

The tasks below

- include_vars: variablefile.yml
- debug:
var: item
  loop: "{{ var1 + var2 + var3 }}"

give

"item": "first_value1"
"item": "first_value2"
"item": "second_value1"
"item": "second_value2"
"item": "third_value1"
"item": "third_value2"

HTH,

-vlado

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200204053624.21bdfc94%40gmail.com.


pgpDJQg2AhuAz.pgp
Description: OpenPGP digital signature


Re: [ansible-project] ansible support

2020-02-03 Thread vishwas govekar
hi 

I am refactoring ansible scripts the client has written for deploying apps 
on Virtual machines
I am trying to define the meta /main.yml file dependencies in galaxy  for 
my ansible script

On Monday, February 3, 2020 at 10:40:42 PM UTC-5, Tabrez Nazir wrote:
>
> Hi vishwas,
> May i know your requirement?
>
> On Tue, Feb 4, 2020, 08:44 vishwas govekar  > wrote:
>
>> Hi 
>> I need some project support on ansible scrippting
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/957b9565-0911-4a1a-9730-03cee311a95b%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0cf811e7-c0bc-4446-bf53-8e6cf8c28b41%40googlegroups.com.


Re: [ansible-project] ansible support

2020-02-03 Thread Tabrez Nazir
Hi vishwas,
May i know your requirement?

On Tue, Feb 4, 2020, 08:44 vishwas govekar  wrote:

> Hi
> I need some project support on ansible scrippting
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/957b9565-0911-4a1a-9730-03cee311a95b%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF_FPv-ENHcJug_gtC7csRAeEE2q%3DTRoqdPB4ESJh7FE54TuJQ%40mail.gmail.com.


Re: [ansible-project] ansible support

2020-02-03 Thread Ankit Vashistha
When you post queries, please try to describe the problem in detail so that
you could get proper response.

*Regards,*
*Ankit*


On Tue, Feb 4, 2020 at 8:44 AM vishwas govekar 
wrote:

> Hi
> I need some project support on ansible scrippting
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/957b9565-0911-4a1a-9730-03cee311a95b%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACecUht7%2BzM7cs_GZzj-SgsdWFyzEz29Ra8tb9H_96-thRSU6w%40mail.gmail.com.


[ansible-project] ansible support

2020-02-03 Thread vishwas govekar
Hi 
I need some project support on ansible scrippting

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/957b9565-0911-4a1a-9730-03cee311a95b%40googlegroups.com.


[ansible-project] start servers using ansible playbook

2020-02-03 Thread Cloud09
Hello Team,

I am writing a playbook to start weblogic servers, could anyone help me any
syntax errors, I could not make item/item display as it should be, or
please feel free to correct me here if any incorrect syntax and would not
work as expected.

---
  - hosts: appservers
become: yes
become_user: cloud9
vars:
  filepath:
- "nohup /opt/jpmc/cloud9/stat/wl12213/cloud9/bin"
  stopservers:
- "/stop-caServer01.sh"
- "/stop-nyServer01.sh"
- "/stop-ohServer01.sh"
tasks:
  - name: Start the admin server
command: "{{item}}/startManagedWebLogic.sh"
  loop:
- filepath
  - name: Start the managed server(s)
command: "{{item}}/{{item}}"
loop:
  - filepath
  - stopservers

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABynDMHLCBttLJXMdNj_ObUfg%2Bp13aGEoCUD59pfXOhOe02fww%40mail.gmail.com.


[ansible-project] Having issues running win_domain_group

2020-02-03 Thread Craig Simon
Hey all,

i've been using Ansibe with Linux for years, but now I have a need to use 
it to build out some Windows boxes and I am running into some issues.  So 
far I am able to instal the AD-DS features and create my domain all 
properly, but I am unable to create any groups in the new domain that I am 
setting up.  When I try I get the error:

TASK [Gathering Facts] 
***
ok: [XX.XX.XX.XX]

TASK [ping test] 
*
ok: [XX.XX.XX.XX]

TASK [create the Mission domain group] 
***
fatal: [XX.XX.XX.XX]: FAILED! => {"changed": false, "created": false, 
"msg": "failed to retrieve initial details for group Mission: Unable to 
contact the server. This may be because this server does not exist, it is 
currently down, or it does not have the Active Directory Web Services 
running."}

PLAY RECAP 
***
XX.XX.XX.XX: ok=2changed=0unreachable=0
failed=1skipped=0rescued=0ignored=0

I can't figure out what is causing this issue.  My reading of the 
documentation only says 

"This must be run on a host that has the ActiveDirectory powershell module 
installed."

I have tested that this is the case by RDPing into the host and performing 
an "Import-Module -Name ActiveDirectory" and the module does import.

The target is a windows 2016 server running in AWS, my Ansible workstation 
is a Mac running Catalina with Ansible installed in a venv via PIP.

Appreciate the help!
Thanks
Craig


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f741f3ec-8ccc-4624-a9e0-b6ecdbb7cac6%40googlegroups.com.


[ansible-project] How to do 3 with_items in the same task ?

2020-02-03 Thread Anand Solomon
Hi,
I am reading 3 different variable from a text file and want to iterate in 3 
different with_items.

variablefile.yml

vars1 :
 - first_value1
 - first_value 2

var2:
 - second_value1
 - second_value2

var3:
 - third_value1
 - third_value2 

I want to read the value from the text file and pass that as a variable in 
loop. 

var_value1: "{{ item }}"
  with_items: "{{ var_value1}}"

var_value2: "{{ item }}"
  with_items: "{{ var_value2}}"

var_value3: "{{ item }}"
  with_items: "{{ var_value3}}"

Not sure how do I do this ?


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c0007dd2-0cbb-4de1-8e81-ed8bf3572df4%40googlegroups.com.


[ansible-project] Error while readin split part for updating Ubuntu packages - Should I include the path of splitpath,py in playbook ?

2020-02-03 Thread Work-Hard
*Hello, Please see below*
*ansible.cfg*
[defaults]
inventory = ./hosts

splitpart.py = /etc/ansible/splitpart.py/

*splitpart.py*
def splitpart (value, index, char = ','):
if isinstance(value, (list, tuple)):
ret = []
for v in value:
ret.append(v.split(char)[index])
return ret
else:
return value.split(char)[index]

class FilterModule(object):
def filters(self):
return {'splitpart': splitpart


*playbook*
  tasks:
# do an "apt-get update", to ensure latest package lists
- name: apt-get update
  apt:
update-cache: yes
  changed_when: 0

# get a list of packages that have updates
- name: get list of pending upgrades
  command: apt-get --simulate dist-upgrade
  args:
warn: false # don't warn us about apt having its own plugin
  register: apt_simulate
  changed_when: 0

# pick out list of pending updates from command output. This essentially
# takes the above output from "apt-get --simulate dist-upgrade", and
# pipes it through "cut -f2 -d' ' | sort"
- name: parse apt-get output to get list of changed packages
  set_fact:
updates: '{{ apt_simulate.stdout_lines | select("match", "^Inst ") 
| list | splitpart(1, " ") | list | sort }}'
  changed_when: 0

# tell user about packages being updated
- name: show pending updates
  debug:
var: updates
  when: updates.0 is defined


*playbook output*

PLAY [myotherserver] 
*

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

TASK [apt-get update] 

ok: [10.0.2.236]

TASK [get list of pending upgrades] 
**
ok: [10.0.2.236]

TASK [parse apt-get output to get list of changed packages] 
**
fatal: [10.0.2.236]: FAILED! => {"msg": "template error while templating 
string: no filter named 'splitpart'. String: {{ apt_simulate.stdout_lines | 
select(\"match\", \"^Inst \") | list | splitpart(1, \" \") | list | sort 
}}"}

PLAY RECAP 
***
10.0.2.236 : ok=3changed=0unreachable=0
failed=1skipped=0rescued=0ignored=0

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9de09a5f-1173-43b7-a2d7-3332ba0e060d%40googlegroups.com.


[ansible-project] Re: Issues with specifying group vars with a dynamic EC2 inventory

2020-02-03 Thread Justin Madill
Well I've found a solution that also fixes the volatility issue by adding a 
group_vars folder beside my playbooks in the project then I can use the 
standard vault variable syntax as well.

On Monday, 3 February 2020 15:05:31 UTC-7, Justin Madill wrote:
>
> I am currently running Ansible 2.9.1 and Tower 3.6.2
>
> On Monday, 3 February 2020 14:55:33 UTC-7, Jordan Borean wrote:
>>
>> This sounds like it was potentially fixed with 
>> https://github.com/ansible/ansible/pull/65023 which has been backported 
>> to Ansible 2.9. What Ansible version are you running?
>>
>> Thanks
>>
>> Jordan
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a76834d8-d17e-4cb5-be7e-799876514cef%40googlegroups.com.


[ansible-project] Re: Issues with specifying group vars with a dynamic EC2 inventory

2020-02-03 Thread Justin Madill
I am currently running Ansible 2.9.1 and Tower 3.6.2

On Monday, 3 February 2020 14:55:33 UTC-7, Jordan Borean wrote:
>
> This sounds like it was potentially fixed with 
> https://github.com/ansible/ansible/pull/65023 which has been backported 
> to Ansible 2.9. What Ansible version are you running?
>
> Thanks
>
> Jordan
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/49bd49c3-5bee-468a-9a7f-489634ac9bcc%40googlegroups.com.


[ansible-project] Re: Issues with specifying group vars with a dynamic EC2 inventory

2020-02-03 Thread Jordan Borean
This sounds like it was potentially fixed with 
https://github.com/ansible/ansible/pull/65023 which has been backported to 
Ansible 2.9. What Ansible version are you running?

Thanks

Jordan

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/feda3107-94b7-422a-b8bc-79803cc3e27e%40googlegroups.com.


[ansible-project] Issues with specifying group vars with a dynamic EC2 inventory

2020-02-03 Thread Justin Madill
I'm currently building out a PoC with Ansible Tower to manage our primarily 
windows environment.
I've had everything working from the command line before starting with 
Tower, that that was using a static inventory.

The problem I'm having right now is finding a method for specifying the 
connection variables for windows servers (without also having them applied 
to non windows servers).
The variables I need to setup are:

ansible_user: ansi...@mydomain.ad
ansible_password: >-
!vault | $ANSIBLE_VAULT;1.1;AES256

35663130633434366336353562303031613263663936653164383937353362643531343561373365

616566356561353137333166613062663631356630340a393764666466346165316337626336

39353764316532693166323931363264363137343466343563613663366434313261623265643066

3130313935343866350a346166363061616338623662343763613630343362653061376465303835
6535
ansible_port: 5985
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
ansible_winrm_transport: kerberos

I was able to manually add them to the ec2 tag based group that i've setup 
for the windows machines, and while they were picked up, it appears to not 
know that it needs to decrypt the password, and putting that vault value in 
with the standard syntax (no >- at the start) just throws a parsing error 
on save.
Though even if I do get this method working if we ever need to rebuild the 
inventory from scratch those values would be lost.

I have read through dozens of issue reports, blog posts, and google group 
posts on this topic and couldn't find any solutions or even other ideas to 
try.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d23af8e8-7d0b-4ca0-8f4d-d6097ed3387d%40googlegroups.com.


[ansible-project] Re: error while deploying docker-ce using ansible

2020-02-03 Thread João Santos
troubleshoot 101...
You can see several keywords, yum, load balancers, and redhat link stuff...

ssh to machine and check if you are able to execute your specific 
task/action?



On Monday, 3 February 2020 17:51:54 UTC, Vishal Bobade wrote:
>
> Hi, 
>
>
> I am facing below error while running ansible role in my environment. 
> could some one quide me how can I fix this.
>
> TASK [docker_base : Install docker-ce] 
> *
>
>  [0;31mfatal: [10.181.56.199]: FAILED! => {"changed": false, "msg": "Failure 
> talking to yum: Could not contact any CDS load balancers: 
> rhui2-cds01.us-east-1.aws.ce.redhat.com, 
> rhui2-cds02.us-east-1.aws.ce.redhat.com."} [0m
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/23eb3b0e-0a80-4e3a-a759-fc0bd7f9701e%40googlegroups.com.


[ansible-project] Re: please advise - Not generating logs after with ansible log_group

2020-02-03 Thread Work-Hard
Any updates are appreciated?

On Friday, January 31, 2020 at 7:11:19 AM UTC-8, Work-Hard wrote:
>
> If you have an example for the playbook and other config to log 
> ansible-recap, please share
>
> On Thursday, January 30, 2020 at 4:12:52 PM UTC-8, Work-Hard wrote:
>>
>> I am unable to generate logs with the playbook. Please advise?
>>
>> *ansible.cfg*
>> [defaults]
>> inventory = ./hosts
>>
>> [callback_log_plays]
>> log_folder = /var/log/ansible/hosts
>> env:ANSIBLE_LOG_FOLDER
>>
>>
>> *host file *
>> [windows]
>> windows mach...@abc.com
>>
>> [windows:vars]
>> ansible_connection = winrm
>> ansible_ssh_port = 5986
>> ansible_winrm_transport = kerberos
>> ansible_winrm_server_cert_validation = ignore
>> validate_certs = false
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5d8a1db9-635f-4968-b28c-e15cde6f2a7e%40googlegroups.com.


[ansible-project] error while deploying docker-ce using ansible

2020-02-03 Thread Vishal Bobade
Hi, 


I am facing below error while running ansible role in my environment. could 
some one quide me how can I fix this.

TASK [docker_base : Install docker-ce] *

 [0;31mfatal: [10.181.56.199]: FAILED! => {"changed": false, "msg": "Failure 
talking to yum: Could not contact any CDS load balancers: 
rhui2-cds01.us-east-1.aws.ce.redhat.com, 
rhui2-cds02.us-east-1.aws.ce.redhat.com."} [0m

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/85759a82-1165-4016-9005-84fc23ec6944%40googlegroups.com.


Re: [ansible-project] install postgresql

2020-02-03 Thread Stefan Hornburg (Racke)
On 2/3/20 4:09 PM, Dick Visser wrote:
> On Mon, 3 Feb 2020 at 15:41, gaddam mahendra  
> wrote:
>>
>> Thanks Dick,
>> But i need to install with user  and database  how could i achive it 
>> when im running my below play book im getting below error could pls help out 
>> it below issue
> 
> Your question was how to install postgresql, so that's the answer you got.
> If you need other things, ask for that.
> 
> Regarding the error you get with postgreql_user, it LITERALLY says
> what's wrong and how to fix it.
> What part do you need helping out with?
> 
> Please make sure to copy/paste the text, and avoid attaching screen dumps.

I agree with that, can't even read it in Thunderbird as the characters appear 
very small.

Regards
  Racke

> 
> Dick
> 
> 
>>  ---
>> # tasks file for ansible-postgresql
>> - name: Add repository
>>   yum_repository:
>> name: epel
>> description: EPEL YUM repo
>> baseurl: 
>> https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
>>
>>
>> #Install the client packages && Optionally install the server packages
>>
>> - yum:
>> name: postgresql10
>> state: present
>>
>> - yum:
>> name: postgresql10-server
>> state: present
>>
>> - name: intialize the DB
>>   command: /usr/pgsql-10/bin/postgresql-10-setup initdb
>>   ignore_errors: yes
>>
>> - name: enable service httpd and ensure it is not masked
>>   systemd:
>> name: postgresql-10
>> enabled:  yes
>>
>>
>> - name: Make sure a service is running
>>   systemd:
>> state: started
>> name: postgresql-10
>>
>>
>> - name: Create kong  user and passwd
>>   postgresql_user:
>> name: kong
>> password: kong111
>> role_attr_flags: CREATEDB,NOSUPERUSER
>>
>> error is below whihc im getting
>>
>>
>>
>>
>> On Mon, Feb 3, 2020 at 2:42 PM Dick Visser  wrote:
>>>
>>> Hi
>>>
>>> This should do it:
>>>
>>>
>>> ---
>>>
>>> - name: Playbook to install postgresql database
>>>   become: true
>>>   hosts: all
>>>
>>>   tasks:
>>> - name: Install postgresql database
>>>   package:
>>> name: postgresql
>>>
>>> On Mon, 3 Feb 2020 at 09:51, gaddam mahendra  
>>> wrote:

 HI Team,
 could you please post a playbook to install postgresql database

 thanks
 mahi

 --
 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 view this discussion on the web visit 
 https://groups.google.com/d/msgid/ansible-project/2bb56463-e7be-4427-b2ee-d1db00e099b7%40googlegroups.com.
>>>
>>>
>>>
>>> --
>>> Dick Visser
>>> Trust & Identity Service Operations Manager
>>> GÉANT
>>>
>>> --
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwPeDjYHNg4tebO0WeWh39JrzcQugsub%3DY5R%2BeeqFZxBpw%40mail.gmail.com.
>>
>> --
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CABvWte2dMtcpG-EJ8GQg6p770jq60Au-BwaBO0Sr_k5U0ueUFQ%40mail.gmail.com.
> 
> 
> 


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8a5cb6a-b2ec-9c30-bc68-510d8d3e0687%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


Re: [ansible-project] install postgresql

2020-02-03 Thread Dick Visser
On Mon, 3 Feb 2020 at 15:41, gaddam mahendra  wrote:
>
> Thanks Dick,
> But i need to install with user  and database  how could i achive it 
> when im running my below play book im getting below error could pls help out 
> it below issue

Your question was how to install postgresql, so that's the answer you got.
If you need other things, ask for that.

Regarding the error you get with postgreql_user, it LITERALLY says
what's wrong and how to fix it.
What part do you need helping out with?

Please make sure to copy/paste the text, and avoid attaching screen dumps.

Dick


>  ---
> # tasks file for ansible-postgresql
> - name: Add repository
>   yum_repository:
> name: epel
> description: EPEL YUM repo
> baseurl: 
> https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
>
>
> #Install the client packages && Optionally install the server packages
>
> - yum:
> name: postgresql10
> state: present
>
> - yum:
> name: postgresql10-server
> state: present
>
> - name: intialize the DB
>   command: /usr/pgsql-10/bin/postgresql-10-setup initdb
>   ignore_errors: yes
>
> - name: enable service httpd and ensure it is not masked
>   systemd:
> name: postgresql-10
> enabled:  yes
>
>
> - name: Make sure a service is running
>   systemd:
> state: started
> name: postgresql-10
>
>
> - name: Create kong  user and passwd
>   postgresql_user:
> name: kong
> password: kong111
> role_attr_flags: CREATEDB,NOSUPERUSER
>
> error is below whihc im getting
>
>
>
>
> On Mon, Feb 3, 2020 at 2:42 PM Dick Visser  wrote:
>>
>> Hi
>>
>> This should do it:
>>
>>
>> ---
>>
>> - name: Playbook to install postgresql database
>>   become: true
>>   hosts: all
>>
>>   tasks:
>> - name: Install postgresql database
>>   package:
>> name: postgresql
>>
>> On Mon, 3 Feb 2020 at 09:51, gaddam mahendra  
>> wrote:
>> >
>> > HI Team,
>> > could you please post a playbook to install postgresql database
>> >
>> > thanks
>> > mahi
>> >
>> > --
>> > 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 view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/ansible-project/2bb56463-e7be-4427-b2ee-d1db00e099b7%40googlegroups.com.
>>
>>
>>
>> --
>> Dick Visser
>> Trust & Identity Service Operations Manager
>> GÉANT
>>
>> --
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwPeDjYHNg4tebO0WeWh39JrzcQugsub%3DY5R%2BeeqFZxBpw%40mail.gmail.com.
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CABvWte2dMtcpG-EJ8GQg6p770jq60Au-BwaBO0Sr_k5U0ueUFQ%40mail.gmail.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPvp-LLKL9sjEz-WEkK7U0w6wLzph07ij6jw6JVTXmzpg%40mail.gmail.com.


Re: [ansible-project] install postgresql

2020-02-03 Thread gaddam mahendra
Thanks Dick,
But i need to install with user  and database  how could i achive
it when im running my below play book im getting below error could pls help
out it below issue
 ---
# tasks file for ansible-postgresql
- name: Add repository
  yum_repository:
name: epel
description: EPEL YUM repo
baseurl:
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm


#Install the client packages && Optionally install the server packages

- yum:
name: postgresql10
state: present

- yum:
name: postgresql10-server
state: present

- name: intialize the DB
  command: /usr/pgsql-10/bin/postgresql-10-setup initdb
  ignore_errors: yes

- name: enable service httpd and ensure it is not masked
  systemd:
name: postgresql-10
enabled:  yes


- name: Make sure a service is running
  systemd:
state: started
name: postgresql-10


- name: Create kong  user and passwd
  postgresql_user:
name: kong
password: kong111
role_attr_flags: CREATEDB,NOSUPERUSER

error is below whihc im getting

[image: image.png]


On Mon, Feb 3, 2020 at 2:42 PM Dick Visser  wrote:

> Hi
>
> This should do it:
>
>
> ---
>
> - name: Playbook to install postgresql database
>   become: true
>   hosts: all
>
>   tasks:
> - name: Install postgresql database
>   package:
> name: postgresql
>
> On Mon, 3 Feb 2020 at 09:51, gaddam mahendra 
> wrote:
> >
> > HI Team,
> > could you please post a playbook to install postgresql database
> >
> > thanks
> > mahi
> >
> > --
> > 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/2bb56463-e7be-4427-b2ee-d1db00e099b7%40googlegroups.com
> .
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwPeDjYHNg4tebO0WeWh39JrzcQugsub%3DY5R%2BeeqFZxBpw%40mail.gmail.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABvWte2dMtcpG-EJ8GQg6p770jq60Au-BwaBO0Sr_k5U0ueUFQ%40mail.gmail.com.


Re: [ansible-project] Convert PowerShell script to Ansible task

2020-02-03 Thread Dick Visser
https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html

On Mon, 3 Feb 2020 at 13:45, Rahul Rawat  wrote:
>
> Hi,
>
> I have to convert PowerShell Script (using if else condition) into anisble 
> task.
> How we can work with condition in ansible tasks.
>
> Here is my powershell script.
>
> $officeInstalled = Get-WmiObject win32_product | where { $_.Name 
> -like "Microsoft Office*" } | select Name,Version
>
> if ($officeInstalled -is [array])
> {
> #
> # Office
> #
>
> $registryPath="HKLM:\SOFTWARE\Classes\Word.Application\CurVer"
> $reg = Get-ItemProperty -Path $registrypath
> $Office_version = $reg.'(default)'
> $Office_version=$Office_version.substring($Office_version.length - 2, 2)
>
> # Remove Microsoft Office policies (if they exist)
> $registryPath=$HKEY+"Software\Policies\Microsoft\Office"
> Remove-RegistryKey $registryPath
>
> #
> # Office 2016
> #
>
> IF ($Office_version -eq "16") {
> Write-Host "Office 2016"
>
> #
> # Common
> #
>
> # Disable 'Welcome to your new Office' dialog
> $registryPath=$HKEY+"Software\Microsoft\Office\16.0\FirstRun"
> Update-Registry $registryPath "BootedRTM" "1" DWORD
> }
>
> regards,
> Rahul
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/d8ff25b8-d251-4860-9662-8106ffc0d524%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwNYikgpWkbEMDzattZnrZK%2BP7_Z1B%2BHkFwySphObNbkGQ%40mail.gmail.com.


[ansible-project] Re: get context extra vars before 2.8

2020-02-03 Thread Eric Lavarde
Hi,

On Saturday, 1 February 2020 20:33:26 UTC+1, FERREIRA CHRISTOPHE wrote:
>
> Hello 
>
> it's possible to get extra_vars on the context of host before 2.8 in 
> python ?
>
> In 2.8 load_extra_vars is work 
>

I'm not sure what you exactly mean, but include_vars and set_fact are 
executed in the context of a host and have existed for quite a long time.

Hope this helps,
Eric

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a1d5aa85-f960-4650-bb12-955d2b92dad9%40googlegroups.com.


[ansible-project] Convert PowerShell script to Ansible task

2020-02-03 Thread Rahul Rawat
Hi,

I have to convert PowerShell Script (using if else condition) into anisble 
task.
How we can work with condition in ansible tasks.

Here is my powershell script.

$officeInstalled = Get-WmiObject win32_product | where { $_.Name 
-like "Microsoft Office*" } | select Name,Version 

if ($officeInstalled -is [array])
{
#
# Office
#

$registryPath="HKLM:\SOFTWARE\Classes\Word.Application\CurVer"
$reg = Get-ItemProperty -Path $registrypath
$Office_version = $reg.'(default)'
$Office_version=$Office_version.substring($Office_version.length - 2, 2)

# Remove Microsoft Office policies (if they exist)
$registryPath=$HKEY+"Software\Policies\Microsoft\Office"
Remove-RegistryKey $registryPath

#
# Office 2016
#

IF ($Office_version -eq "16") {
Write-Host "Office 2016"

#
# Common
#

# Disable 'Welcome to your new Office' dialog
$registryPath=$HKEY+"Software\Microsoft\Office\16.0\FirstRun"
Update-Registry $registryPath "BootedRTM" "1" DWORD
}

regards,
Rahul 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d8ff25b8-d251-4860-9662-8106ffc0d524%40googlegroups.com.


Re: [ansible-project] install postgresql

2020-02-03 Thread Dick Visser
Hi

This should do it:


---

- name: Playbook to install postgresql database
  become: true
  hosts: all

  tasks:
- name: Install postgresql database
  package:
name: postgresql

On Mon, 3 Feb 2020 at 09:51, gaddam mahendra  wrote:
>
> HI Team,
> could you please post a playbook to install postgresql database
>
> thanks
> mahi
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/2bb56463-e7be-4427-b2ee-d1db00e099b7%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPeDjYHNg4tebO0WeWh39JrzcQugsub%3DY5R%2BeeqFZxBpw%40mail.gmail.com.


[ansible-project] install postgresql

2020-02-03 Thread gaddam mahendra
HI Team,
could you please post a playbook to install postgresql database

thanks
mahi

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2bb56463-e7be-4427-b2ee-d1db00e099b7%40googlegroups.com.