Re: [ansible-project] Modifying CIDR of an existing EC2 Security Groups using Ansible

2021-04-26 Thread Naveen NK

Is there any other options to achieve this ? I have been stuck here since 
week :(
On Monday, April 26, 2021 at 3:29:32 PM UTC+5:30 komalsuth...@gmail.com 
wrote:

> In this ec2_group module i don't think that we can solve this use case 
>
> On Mon, Apr 26, 2021, 11:04 AM Naveen NK  wrote:
>
>> Can we modify existing EC2 Security group using Ansible by accepting new 
>> input parameter through jenkins job?
>>
>> Scenario - I have to update users public IP to Ec2 security groups 
>> everyday Whenever their Public ip changes. This become repetitive tasks as 
>> Public IP is dynamic and changes everyday. I tried to automate this by 
>> creating ansible playbook with jenkins job by passing input parameter *"{{ 
>> newpublicip }}"* for new public ip and let user provide his IP and run 
>> the job and it updates the security groups. Below is the code
>> - hosts: localhost
>> connection: local
>> gather_facts: false
>>
>> vars:
>> - newpublicip: "{{ newpublicip }}"
>> - name: "{{ name }}"
>>
>>
>> tasks:
>> - name: boto3
>> pip:
>> name: "boto3"
>> state: present
>>
>> - name: modiying security group
>> ec2_group:
>> name: "{{ name }}"
>> description: An example ec2 group
>> vpc_id: 
>> region: "{{ region }}"
>> aws_access_key: "{{ access_key }}"
>> aws_secret_key: "{{ secret_key }}"
>> rules:
>> - proto: tcp
>> from_port: 80
>> to_port: 80
>> cidr_ip: "0.0.0.0/0"
>> - proto: tcp
>> from_port: 22
>> to_port: 22
>> cidr_ip: "{{ newpublicip }}"
>> rule_desc: user1
>> - proto: tcp
>> from_port: 22
>> to_port: 22
>> cidr_ip: "{{ newpublicip }}"
>> rule_desc: user2
>>
>> But the problem here is it updates whole existing security group with 
>> passed value, Here we will have different users assigned same port numbers 
>> with their public IP as source to access, so based on matching the 
>> rule_desc ex., user1 it should update the CIDR ip with input value provided 
>> *"{{ 
>> newpublicip }}"* Or please suggest some options to improvise this?
>>
>> Thank you !
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/7a7674af-d06c-4043-a67f-51532da62c38n%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/cba1cb00-e1e6-4aa8-8d36-d0e4b8cf04den%40googlegroups.com.


[ansible-project] New release: ansible-core 2.11.0

2021-04-26 Thread Rick Elrod
Hi all- we're happy to announce that the general release of ansible-core 2.11.0
is now available!

--

Some information about ansible-core 2.11:

ansible-core 2.11 is a rename of ansible-base. As with ansible-base, it includes
only a minimal, vetted set of modules and plugins, and is extensible through the
use of Ansible Collections. This release of ansible-core includes some new
features and changes that we'd like to highlight below. This list is not
exhaustive:

- As of this release, Python 3.8 is now a *soft requirement* on the
  controller. (This release will continue to work with the same versions of
  Python as ansible-base 2.10, but ansible-core 2.12 will NOT)

- Role arguments can now be validated at runtime to ensure that roles are used
  correctly

- ansible-galaxy now makes use of "resolvelib" for resolving dependencies

- New virtualization facts are now included (as lists), so that administrators
  can see all virtual guest and host technologies available to the node

- Playbooks can now be run from collections

- For module authors, module_utils imports are now treated as optional if in
  any nested block (such as 'try' or 'if') allowing for implementation of
  fallback behavior for module_utils that do not exist in older versions of
  Ansible.

Solaris users:
NOTE: There is a known bug in ansible-core 2.11.0 which affects Solaris (and
Solaris-derived) managed nodes, when connecting as an unprivileged user and
becoming a different unprivileged user. This bug results in several fallback
behaviors not executing. In particular, ALLOW_WORLD_READABLE_TMPFILES and
the shell option "common_remote_group" have no effect and these fallback
methods are not run. This will be fixed in 2.11.1.

--

How to get it
-

$ pip install ansible-core==2.11.0 --user

The tar.gz of the release can be found here:

* ansible-core 2.11.0
  
https://pypi.python.org/packages/source/a/ansible-core/ansible-core-2.11.0.tar.gz
  SHA256: 9470ceb710711eacd75f1bcae802af036ab2a6c2cd5a13bfcb50b2d89667c9c5


What's new in ansible-core 2.11.0
-

This release is a maintenance release containing numerous bugfixes. The full
changelog is at:

* 2.11.0
  
https://github.com/ansible/ansible/blob/stable-2.11/changelogs/CHANGELOG-v2.11.rst


What's the schedule for future maintenance releases?


ansible-core 2.11.1 RC1 is planned for 17 May 2021, with GA to follow one week
after.


Porting Help


We've published a porting guide at
https://docs.ansible.com/ansible-core/devel/porting_guides/porting_guide_core_2.11.html
to help migrate your content to 2.11.



If you discover any errors or if any of your working playbooks break when you
upgrade to 2.11.0, please use the following link to report the regression:

  https://github.com/ansible/ansible/issues/new/choose

In your issue, be sure to mention the version that works and the one that
doesn't.

Thanks!

-Rick Elrod

-- 
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/CAMuUyjQQ4AahQJs-XWFDsN2v%2BmXWJmCwZN7wAx5UDv4LpGAAng%40mail.gmail.com.


[ansible-project] Test Coverage Report When Testing Roles with Molecule

2021-04-26 Thread Cindy
Hello.

Is there a way to gather a quantitative data about test coverage for 
molecule test created for an ansible role?

-- 
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/a2d8ca62-dbe2-4d76-9d1e-94f1ee89c695n%40googlegroups.com.


[ansible-project] Re: Complete debug output to file

2021-04-26 Thread Dimitri Yioulos
Racke,

For my edification, might I ask exactly what your code does?

Thanks,

Dimitri

On Monday, April 26, 2021 at 9:03:19 AM UTC-4 Dimitri Yioulos wrote:

> Hello, all.
>
> It's been a long time since I posted here, so please forgive any posting 
> faux pas.
>
> I've created the following playboos:
>
> ---
> - name: report aws migrator
>   hosts: all
>   gather_facts: false
>   tasks:
> - name: collect facts
>   shell:
> cmd: facter -p fqdn processorcount memorysize_mb 
> blockdevice_sda_size blockdevice_vda_size operatingsystem 
> operatingsystemrelease is_virtual processor0 --json
>   register: facter_output
>
> - name: print output
>   debug:
> msg: "{{ facter_output.stdout }}"
> - local_action: copy content="{{ facter_output.stdout }}". 
> dest="/Users/dyioulos/Documents/prodrept.txt"
>
> The problem is with the output to file.  Data are overwritten, and 
> information for only the last host the playbook is run against is 
> captured.  Additionally, i have to put any character here (denoted by ^): - 
> local_action: copy content="{{ facter_output.stdout }}"^ 
> dest="/Users/dyioulos/Documents/prodrept.txt" in order for the output to be 
> in json format.  That extra character is also printed, including if I use 
> newline) is also printed.
>
> Your help in soving this would be greatly appreciated.
>

-- 
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/a96da287-a3ec-430b-aa67-4efc3b90c824n%40googlegroups.com.


[ansible-project] Re: Complete debug output to file

2021-04-26 Thread Dimitri Yioulos
That worked great; thank you so much!

On Monday, April 26, 2021 at 9:03:19 AM UTC-4 Dimitri Yioulos wrote:

> Hello, all.
>
> It's been a long time since I posted here, so please forgive any posting 
> faux pas.
>
> I've created the following playboos:
>
> ---
> - name: report aws migrator
>   hosts: all
>   gather_facts: false
>   tasks:
> - name: collect facts
>   shell:
> cmd: facter -p fqdn processorcount memorysize_mb 
> blockdevice_sda_size blockdevice_vda_size operatingsystem 
> operatingsystemrelease is_virtual processor0 --json
>   register: facter_output
>
> - name: print output
>   debug:
> msg: "{{ facter_output.stdout }}"
> - local_action: copy content="{{ facter_output.stdout }}". 
> dest="/Users/dyioulos/Documents/prodrept.txt"
>
> The problem is with the output to file.  Data are overwritten, and 
> information for only the last host the playbook is run against is 
> captured.  Additionally, i have to put any character here (denoted by ^): - 
> local_action: copy content="{{ facter_output.stdout }}"^ 
> dest="/Users/dyioulos/Documents/prodrept.txt" in order for the output to be 
> in json format.  That extra character is also printed, including if I use 
> newline) is also printed.
>
> Your help in soving this would be greatly appreciated.
>

-- 
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/68fbeb0e-76e7-4a81-b132-1c0dec70e2c7n%40googlegroups.com.


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread Antony Stone
On Monday 26 April 2021 at 16:28:08, NAVEEN wrote:

> Hi
> Anyone available for job support on ansible ..if any pls email me on
> naveenkr...@gmail.com

Please do not hijack conversation threads for new topics - start a new thread 
with an appropriate subject of its own.


Thank you,


Antony.

-- 
https://tools.ietf.org/html/rfc6890 - providing 16 million IPv4 addresses for 
talking to yourself.

   Please reply to the list;
 please *don't* CC me.


Re: [ansible-project] Complete debug output to file

2021-04-26 Thread Stefan Hornburg (Racke)
On 4/26/21 3:03 PM, Dimitri Yioulos wrote:
> Hello, all.
> 
> It's been a long time since I posted here, so please forgive any posting faux 
> pas.
> 
> I've created the following playboos:
> 
> ---
> - name: report aws migrator
>   hosts: all
>   gather_facts: false
>   tasks:
>     - name: collect facts
>       shell:
>         cmd: facter -p fqdn processorcount memorysize_mb blockdevice_sda_size 
> blockdevice_vda_size operatingsystem
> operatingsystemrelease is_virtual processor0 --json
>       register: facter_output
> 
>     - name: print output
>       debug:
>         msg: "{{ facter_output.stdout }}"
>     - local_action: copy content="{{ facter_output.stdout }}". 
> dest="/Users/dyioulos/Documents/prodrept.txt"
> 
> The problem is with the output to file.  Data are overwritten, and 
information for only the last host the playbook is
> run against is captured.  Additionally, i have to put any character here 
> (denoted by ^): - local_action: copy
> content="{{ facter_output.stdout }}"^ 
> dest="/Users/dyioulos/Documents/prodrept.txt" in order for the output to be in
> json format.  That extra character is also printed, including if I 
use newline) is also printed.
> 
> Your help in soving this would be greatly appreciated.

Hello Dimitri,

to collect the output from all hosts please try the following approach:

- local_action:
module: copy
content: |
  {% for host in ansible_play_hosts %}
  {{ host }}
  {{ hostvars[host]['facter_output']['stdout'] }}

  {% endfor %}
dest: "/Users/dyioulos/Documents/prodrept.txt"
  run_once: yes

Regards
 Racke

> 
> -- 
> 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/1fb0f55b-9eeb-461c-816b-ed292d068e5cn%40googlegroups.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/d3fb21d9-e96b-cc3c-cbf2-ae634660c20e%40linuxia.de.


OpenPGP_signature
Description: OpenPGP digital signature


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread NAVEEN
Hi
Anyone available for job support on ansible ..if any pls email me on
naveenkr...@gmail.com

Thank you
Naveen

On Mon, Apr 26, 2021, 16:41 Mauricio Tavares  wrote:

> How about if you start your own thread instead of breaking into
> someone else's? Your question has nothing to do with the OP's
>
> On Mon, Apr 26, 2021 at 6:00 AM Naveen Konduru 
> wrote:
> >
> > do u have any sample code  ...if u have pls share with me
> >
> > On Monday, April 26, 2021 at 3:28:21 PM UTC+5:30 komalsuth...@gmail.com
> wrote:
> >>
> >> You can use jinja templates for getting the facts of the server and use
> template modules for creating your file.
> >>
> >> On Mon, Apr 26, 2021, 2:54 PM Naveen Konduru 
> wrote:
> >>>
> >>> Hello Team ,
> >>> I have oen requirement on Ansible with Hp ILO server..
> >>>
> >>> I am new to ansible.Need help  from you people.
> >>> Requirement is
> >>>  Have to  connect Hp ilo serverr using SSH and get SWId's details
> and  the out out  i have to display in csv file.. can any implementation
> pls do let me know.
> >>> Naveen
> >>>
> >>> On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com
> wrote:
> 
>  Please someone help me. I do not understand why i get this error. I
> can ssh from my control node to this host and from the host to my control
> node. But ansible test show this results.
> 
>  192.168.154.163 | UNREACHABLE! => {
>  "changed": false,
>  "msg": "Failed to connect to the host via ssh:
> con...@192.168.154.163: Permission denied (publickey,password).",
>  "unreachable": true
> 
>  this is my inventory:
> 
>  192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user
> 
>  Thank you
> 
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups "Ansible Project" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> an email to ansible-proje...@googlegroups.com.
> >>>
> >>> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/35390e98-0044-4ad8-8d91-a389e89604fdn%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/781d9d2e-6899-4057-9732-87320e54c53bn%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/CAHEKYV60Szx3r0%3D2c-ovVCjoxYz0j-GDDDRNhqtVnAAfk4bpJg%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/CAB_%3D4obeFgwx7NK9NdKUJ4%3DeA831LLAbwyN8FR7NwxBS9gRv3Q%40mail.gmail.com.


Re: [ansible-project] Re: Backwards compatible Ansible Collection support in project?

2021-04-26 Thread Erik Godding Boye
Thanks for your feedback! I am not asking for a "migration path to every
custom workflow". I just would like to see some support tools to facilitate
the migration from a typically legacy Ansible project setup, to the modern
collection layout - which I think provides far better organization and
metadata description.

Are you able to provide some links or references to "examples for migrating
roles that will handle the fqcn vs non fqcn referencing and module_utils
imports", even in WIP state? That sounds interesting!

Erik

On Thu, Apr 22, 2021 at 3:50 PM Brian Coca  wrote:

> As for the plugin issue, there should be examples for migrating roles
> that will handle the fqcn vs non fqcn referencing and module_utils
> imports in the works.
>
>
>
>
> --
> --
> Brian Coca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CACVha7ecPEHSvVW%3D8YcqUH5_-GY1%2BYYk%3DzdYKNW8radOa61ALw%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/CALfBRgHmY-9mrgM0jJq92%3D%3DseKjh01i8j6XDTbrioJFKVcM74w%40mail.gmail.com.


[ansible-project] Complete debug output to file

2021-04-26 Thread Dimitri Yioulos
Hello, all.

It's been a long time since I posted here, so please forgive any posting 
faux pas.

I've created the following playboos:

---
- name: report aws migrator
  hosts: all
  gather_facts: false
  tasks:
- name: collect facts
  shell:
cmd: facter -p fqdn processorcount memorysize_mb 
blockdevice_sda_size blockdevice_vda_size operatingsystem 
operatingsystemrelease is_virtual processor0 --json
  register: facter_output

- name: print output
  debug:
msg: "{{ facter_output.stdout }}"
- local_action: copy content="{{ facter_output.stdout }}". 
dest="/Users/dyioulos/Documents/prodrept.txt"

The problem is with the output to file.  Data are overwritten, and 
information for only the last host the playbook is run against is 
captured.  Additionally, i have to put any character here (denoted by ^): - 
local_action: copy content="{{ facter_output.stdout }}"^ 
dest="/Users/dyioulos/Documents/prodrept.txt" in order for the output to be 
in json format.  That extra character is also printed, including if I use 
newline) is also printed.

Your help in soving this would be greatly appreciated.

-- 
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/1fb0f55b-9eeb-461c-816b-ed292d068e5cn%40googlegroups.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread rebecca acheampong
Thank you very much...taking a look at it

On Mon, Apr 26, 2021 at 2:39 PM Mauricio Tavares 
wrote:

> On Mon, Apr 26, 2021 at 7:07 AM rebecca acheampong 
> wrote:
> >
> >
> > I wish i could separate them as you have told me but i am very new to
> ansible and I am using it for my final project. I dont know how to do that.
> I changed the host to the target node's name. I think you are right because
> the localhost does the installation of the docker on the control node. But
> I do not know what to do.
>
> Here is a sample ansible playbook; don't know who wrote it. Take a
> look at it. Ask questions. Once you understand it, what you are trying
> to do should make sense.
>
> https://www.ansible.com/blog/getting-started-writing-your-first-playbook
>
> > On Monday, April 26, 2021 at 1:47:06 PM UTC+3 dick@geant.org wrote:
> >>
> >> You're using localhost as the target, which is OK for the vmware
> >> module (as that is an API based one), but then you also target
> >> localhost for the docker stuff.
> >> Split your deployment into separate playbook and make sure you're
> >> targeting the correct host.
> >> This may involve add_host etc.
> >>
> >> On Mon, 26 Apr 2021 at 12:21, rebecca acheampong 
> wrote:
> >> >
> >> > I am using ansible to install a docker but I get this error. How can
> i solve this please?
> >> > Please help me, this installation has taken me a whole week
> >> >
> >> > Control node is ubuntu server 20.04
> >> > Target node is ubuntu desktop 18.04 on vmware esxi
> >> >
> >> > this is my playbook:
> >> > ---
> >> > - name: installing docker on ubuntu
> >> > hosts: localhost
> >> > remote_user: "{{ remote_user_name }}"
> >> > gather_facts: no
> >> > vars_files:
> >> > - var_docker.yml
> >> > vars:
> >> > remote_user_name: cyber01
> >> > apt_repo_data: "deb [arch=amd64]
> >> > https://download.docker.com/linux/ubuntu xenial stable"
> >> > apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
> >> > tasks:
> >> > - vmware_guest:
> >> > hostname: "{{ VMWARE_HOST }}"
> >> > username: "{{ VMWARE_USER }}"
> >> > password: "{{ VMWARE_PASSWORD }}"
> >> > validate_certs: no
> >> > folder: /ha-datacenter/vm/
> >> > name: my_vm_01
> >> > - name: adding docker gpg key
> >> > apt_key:
> >> > url: "{{ apt_gpg_key }}"
> >> > state: present
> >> > - name: add docker repository
> >> > apt_repository:
> >> > repo: "{{ apt_repo_data }}"
> >> > state: present
> >> > - name: installing docker-ce
> >> > apt:
> >> > name: docker-ce
> >> > state: present
> >> > update_cache: yes
> >> > - name: install python-pip
> >> > apt:
> >> > name: python-pip
> >> > state: present
> >> > - name: install docker-py
> >> > pip:
> >> > name: docker-py
> >> > state: present
> >> >
> >> > run playbook: ansible-playbook -i hosts docker_contairner.yml
> >> >
> >> > PLAY [installing docker on ubuntu]
> *
> >> >
> >> > TASK [vmware_guest]
> 
> >> > ok: [my_vm_01]
> >> >
> >> > TASK [adding docker gpg key]
> ***
> >> > fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd":
> "/usr/bin/apt-key add -", "msg": "Warning: apt-key output should not be
> parsed (stdout is not a terminal)\nE: This command can only be used by
> root.", "rc": 1, "stderr": "Warning: apt-key output should not be parsed
> (stdout is not a terminal)\nE: This command can only be used by root.\n",
> "stderr_lines": ["Warning: apt-key output should not be parsed (stdout is
> not a terminal)", "E: This command can only be used by root."], "stdout":
> "", "stdout_lines": []}
> >> >
> >> > --
> >> > 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/ebd3bf51-8f39-40b3-b8bb-276bcaefa594n%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/CAHEKYV7EUpgu2%2B_3w9uamJ1voe5QWm0PJxsRC78SJw_nOk29Kw%40mail.gmail.com
> .
>

-- 
You received this message 

Re: [ansible-project] docker installation problems

2021-04-26 Thread rebecca acheampong
Thank you so much. I am looking at it

On Mon, Apr 26, 2021 at 2:45 PM Nuno Jordão  wrote:

> A playbook is a list of plays. Example:
>
> ---
> - name: play1
>   hosts: host1
>   tasks:
> - name:
>etc...
>
> - name: play2
>   hosts: host2
>   tasks:
> - name:
>
> On Mon, Apr 26, 2021 at 12:08 PM rebecca acheampong 
> wrote:
>
>>
>> I wish i could separate them as you have told me but i am very new to
>> ansible and I am using it for my final project. I dont know how to do that.
>> I changed the host to the target node's name. I think you are right because
>> the localhost does the installation of the docker on the control node. But
>> I do not know what to do.
>> On Monday, April 26, 2021 at 1:47:06 PM UTC+3 dick@geant.org wrote:
>>
>>> You're using localhost as the target, which is OK for the vmware
>>> module (as that is an API based one), but then you also target
>>> localhost for the docker stuff.
>>> Split your deployment into separate playbook and make sure you're
>>> targeting the correct host.
>>> This may involve add_host etc.
>>>
>>> On Mon, 26 Apr 2021 at 12:21, rebecca acheampong 
>>> wrote:
>>> >
>>> > I am using ansible to install a docker but I get this error. How can i
>>> solve this please?
>>> > Please help me, this installation has taken me a whole week
>>> >
>>> > Control node is ubuntu server 20.04
>>> > Target node is ubuntu desktop 18.04 on vmware esxi
>>> >
>>> > this is my playbook:
>>> > ---
>>> > - name: installing docker on ubuntu
>>> > hosts: localhost
>>> > remote_user: "{{ remote_user_name }}"
>>> > gather_facts: no
>>> > vars_files:
>>> > - var_docker.yml
>>> > vars:
>>> > remote_user_name: cyber01
>>> > apt_repo_data: "deb [arch=amd64]
>>> > https://download.docker.com/linux/ubuntu xenial stable"
>>> > apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>>> > tasks:
>>> > - vmware_guest:
>>> > hostname: "{{ VMWARE_HOST }}"
>>> > username: "{{ VMWARE_USER }}"
>>> > password: "{{ VMWARE_PASSWORD }}"
>>> > validate_certs: no
>>> > folder: /ha-datacenter/vm/
>>> > name: my_vm_01
>>> > - name: adding docker gpg key
>>> > apt_key:
>>> > url: "{{ apt_gpg_key }}"
>>> > state: present
>>> > - name: add docker repository
>>> > apt_repository:
>>> > repo: "{{ apt_repo_data }}"
>>> > state: present
>>> > - name: installing docker-ce
>>> > apt:
>>> > name: docker-ce
>>> > state: present
>>> > update_cache: yes
>>> > - name: install python-pip
>>> > apt:
>>> > name: python-pip
>>> > state: present
>>> > - name: install docker-py
>>> > pip:
>>> > name: docker-py
>>> > state: present
>>> >
>>> > run playbook: ansible-playbook -i hosts docker_contairner.yml
>>> >
>>> > PLAY [installing docker on ubuntu]
>>> *
>>> >
>>> > TASK [vmware_guest]
>>> 
>>> > ok: [my_vm_01]
>>> >
>>> > TASK [adding docker gpg key]
>>> ***
>>> > fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd":
>>> "/usr/bin/apt-key add -", "msg": "Warning: apt-key output should not be
>>> parsed (stdout is not a terminal)\nE: This command can only be used by
>>> root.", "rc": 1, "stderr": "Warning: apt-key output should not be parsed
>>> (stdout is not a terminal)\nE: This command can only be used by root.\n",
>>> "stderr_lines": ["Warning: apt-key output should not be parsed (stdout is
>>> not a terminal)", "E: This command can only be used by root."], "stdout":
>>> "", "stdout_lines": []}
>>> >
>>> > --
>>> > 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/ebd3bf51-8f39-40b3-b8bb-276bcaefa594n%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/CAEAA%3DtticGFOdoPJUwh-YXL_JeoovpNyenEe_VwNErBbdgmGWQ%40mail.gmail.com
> 

Re: [ansible-project] docker installation problems

2021-04-26 Thread Nuno Jordão
A playbook is a list of plays. Example:

---
- name: play1
  hosts: host1
  tasks:
- name:
   etc...

- name: play2
  hosts: host2
  tasks:
- name:

On Mon, Apr 26, 2021 at 12:08 PM rebecca acheampong 
wrote:

>
> I wish i could separate them as you have told me but i am very new to
> ansible and I am using it for my final project. I dont know how to do that.
> I changed the host to the target node's name. I think you are right because
> the localhost does the installation of the docker on the control node. But
> I do not know what to do.
> On Monday, April 26, 2021 at 1:47:06 PM UTC+3 dick@geant.org wrote:
>
>> You're using localhost as the target, which is OK for the vmware
>> module (as that is an API based one), but then you also target
>> localhost for the docker stuff.
>> Split your deployment into separate playbook and make sure you're
>> targeting the correct host.
>> This may involve add_host etc.
>>
>> On Mon, 26 Apr 2021 at 12:21, rebecca acheampong 
>> wrote:
>> >
>> > I am using ansible to install a docker but I get this error. How can i
>> solve this please?
>> > Please help me, this installation has taken me a whole week
>> >
>> > Control node is ubuntu server 20.04
>> > Target node is ubuntu desktop 18.04 on vmware esxi
>> >
>> > this is my playbook:
>> > ---
>> > - name: installing docker on ubuntu
>> > hosts: localhost
>> > remote_user: "{{ remote_user_name }}"
>> > gather_facts: no
>> > vars_files:
>> > - var_docker.yml
>> > vars:
>> > remote_user_name: cyber01
>> > apt_repo_data: "deb [arch=amd64]
>> > https://download.docker.com/linux/ubuntu xenial stable"
>> > apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>> > tasks:
>> > - vmware_guest:
>> > hostname: "{{ VMWARE_HOST }}"
>> > username: "{{ VMWARE_USER }}"
>> > password: "{{ VMWARE_PASSWORD }}"
>> > validate_certs: no
>> > folder: /ha-datacenter/vm/
>> > name: my_vm_01
>> > - name: adding docker gpg key
>> > apt_key:
>> > url: "{{ apt_gpg_key }}"
>> > state: present
>> > - name: add docker repository
>> > apt_repository:
>> > repo: "{{ apt_repo_data }}"
>> > state: present
>> > - name: installing docker-ce
>> > apt:
>> > name: docker-ce
>> > state: present
>> > update_cache: yes
>> > - name: install python-pip
>> > apt:
>> > name: python-pip
>> > state: present
>> > - name: install docker-py
>> > pip:
>> > name: docker-py
>> > state: present
>> >
>> > run playbook: ansible-playbook -i hosts docker_contairner.yml
>> >
>> > PLAY [installing docker on ubuntu]
>> *
>> >
>> > TASK [vmware_guest]
>> 
>> > ok: [my_vm_01]
>> >
>> > TASK [adding docker gpg key]
>> ***
>> > fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd":
>> "/usr/bin/apt-key add -", "msg": "Warning: apt-key output should not be
>> parsed (stdout is not a terminal)\nE: This command can only be used by
>> root.", "rc": 1, "stderr": "Warning: apt-key output should not be parsed
>> (stdout is not a terminal)\nE: This command can only be used by root.\n",
>> "stderr_lines": ["Warning: apt-key output should not be parsed (stdout is
>> not a terminal)", "E: This command can only be used by root."], "stdout":
>> "", "stdout_lines": []}
>> >
>> > --
>> > 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/ebd3bf51-8f39-40b3-b8bb-276bcaefa594n%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/CAEAA%3DtticGFOdoPJUwh-YXL_JeoovpNyenEe_VwNErBbdgmGWQ%40mail.gmail.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread Mauricio Tavares
On Mon, Apr 26, 2021 at 7:07 AM rebecca acheampong  wrote:
>
>
> I wish i could separate them as you have told me but i am very new to ansible 
> and I am using it for my final project. I dont know how to do that. I changed 
> the host to the target node's name. I think you are right because the 
> localhost does the installation of the docker on the control node. But I do 
> not know what to do.

Here is a sample ansible playbook; don't know who wrote it. Take a
look at it. Ask questions. Once you understand it, what you are trying
to do should make sense.

https://www.ansible.com/blog/getting-started-writing-your-first-playbook

> On Monday, April 26, 2021 at 1:47:06 PM UTC+3 dick@geant.org wrote:
>>
>> You're using localhost as the target, which is OK for the vmware
>> module (as that is an API based one), but then you also target
>> localhost for the docker stuff.
>> Split your deployment into separate playbook and make sure you're
>> targeting the correct host.
>> This may involve add_host etc.
>>
>> On Mon, 26 Apr 2021 at 12:21, rebecca acheampong  wrote:
>> >
>> > I am using ansible to install a docker but I get this error. How can i 
>> > solve this please?
>> > Please help me, this installation has taken me a whole week
>> >
>> > Control node is ubuntu server 20.04
>> > Target node is ubuntu desktop 18.04 on vmware esxi
>> >
>> > this is my playbook:
>> > ---
>> > - name: installing docker on ubuntu
>> > hosts: localhost
>> > remote_user: "{{ remote_user_name }}"
>> > gather_facts: no
>> > vars_files:
>> > - var_docker.yml
>> > vars:
>> > remote_user_name: cyber01
>> > apt_repo_data: "deb [arch=amd64]
>> > https://download.docker.com/linux/ubuntu xenial stable"
>> > apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>> > tasks:
>> > - vmware_guest:
>> > hostname: "{{ VMWARE_HOST }}"
>> > username: "{{ VMWARE_USER }}"
>> > password: "{{ VMWARE_PASSWORD }}"
>> > validate_certs: no
>> > folder: /ha-datacenter/vm/
>> > name: my_vm_01
>> > - name: adding docker gpg key
>> > apt_key:
>> > url: "{{ apt_gpg_key }}"
>> > state: present
>> > - name: add docker repository
>> > apt_repository:
>> > repo: "{{ apt_repo_data }}"
>> > state: present
>> > - name: installing docker-ce
>> > apt:
>> > name: docker-ce
>> > state: present
>> > update_cache: yes
>> > - name: install python-pip
>> > apt:
>> > name: python-pip
>> > state: present
>> > - name: install docker-py
>> > pip:
>> > name: docker-py
>> > state: present
>> >
>> > run playbook: ansible-playbook -i hosts docker_contairner.yml
>> >
>> > PLAY [installing docker on ubuntu] 
>> > *
>> >
>> > TASK [vmware_guest] 
>> > 
>> > ok: [my_vm_01]
>> >
>> > TASK [adding docker gpg key] 
>> > ***
>> > fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key 
>> > add -", "msg": "Warning: apt-key output should not be parsed (stdout is 
>> > not a terminal)\nE: This command can only be used by root.", "rc": 1, 
>> > "stderr": "Warning: apt-key output should not be parsed (stdout is not a 
>> > terminal)\nE: This command can only be used by root.\n", "stderr_lines": 
>> > ["Warning: apt-key output should not be parsed (stdout is not a 
>> > terminal)", "E: This command can only be used by root."], "stdout": "", 
>> > "stdout_lines": []}
>> >
>> > --
>> > 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 view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/ebd3bf51-8f39-40b3-b8bb-276bcaefa594n%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/CAHEKYV7EUpgu2%2B_3w9uamJ1voe5QWm0PJxsRC78SJw_nOk29Kw%40mail.gmail.com.


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread Mauricio Tavares
On Fri, Apr 23, 2021 at 12:24 PM rebecca acheampong  wrote:
>
> Thank you. Trying the options. I have sat on it the whole day, i feel 
> exhausted with it.
> Thank you. I will get back whatever results i have
>
  Some suggestions, assuming the name of the host you want to run
ansible on is 'cyber01' and going from simpler to more sophisticated:

1. Test by passing the username and asking for the password from the
command line. In this example I am just running the 'whoami' command:

ansible cyber01 --extra-vars 'ansible_user=user' --ask-pass -a whoami

2. Do not have passwords defined in your inventory. If you need a
password, ask for them as shown above.

3. Instead of password, consider a SSH keypair. This way you can have
something like this in your inventory

192.168.154.163 ansible_ssh_private_key_file="~/.ssh/cyber01" ansible_user=user

Note it is looking for the private key at my user's default location;
where you place it depends on your needs.

4. Consider having a host_vars/cyber01.yml file instead of cluttering
the inventory one. You can then populate this file with all the
initial constants you need (IP address, username, etc), passing any
variables that might change at runtime using --extra_vars as shown
above.

> On Fri, Apr 23, 2021 at 6:52 PM Tej Singh Rana  
> wrote:
>>
>> You can find more from this link - 
>> https://docs.ansible.com/ansible/2.3/intro_inventory.html#list-of-behavioral-inventory-parameters
>>
>>
>> On Fri, Apr 23, 2021 at 9:10 PM Rajit Paul  wrote:
>>>
>>> Try ansible_ssh_user and ansible_ssh_pass as keywords in the inventory and 
>>> set privilege escalation in the ansible.cfg file also add the user to the 
>>> sudoers list in managed node as per requirement.
>>>
>>> On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com wrote:

 Please someone help me. I do not understand why i get this error. I can 
 ssh from my control node to this host and from the host to my control 
 node. But ansible test show this results.

 192.168.154.163 | UNREACHABLE! => {
 "changed": false,
 "msg": "Failed to connect to the host via ssh: con...@192.168.154.163: 
 Permission denied (publickey,password).",
 "unreachable": true

 this is my inventory:

 192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user

 Thank you

>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to ansible-project+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/07eff594-54ac-4b53-8f95-7c04c54c5261n%40googlegroups.com.
>>
>>
>>
>> --
>> -
>> Tej Singh Rana
>>
>> --
>> 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/CADBoQTpJNUnRkmYLWUgjA9PbuVr6q6X7an9Gno%3Dvs27BXnD-AA%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/CAKQAy6qXt-HBEJFO-o3HAzbcKkXrueQBNFzcgXs5k1-dT%3DYC6g%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/CAHEKYV5kyy%2B4KEzymX%3DpHwCq8aaYERxJ9WjgCtkz2LsK_Z%3D8aQ%40mail.gmail.com.


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread Mauricio Tavares
How about if you start your own thread instead of breaking into
someone else's? Your question has nothing to do with the OP's

On Mon, Apr 26, 2021 at 6:00 AM Naveen Konduru  wrote:
>
> do u have any sample code  ...if u have pls share with me
>
> On Monday, April 26, 2021 at 3:28:21 PM UTC+5:30 komalsuth...@gmail.com wrote:
>>
>> You can use jinja templates for getting the facts of the server and use 
>> template modules for creating your file.
>>
>> On Mon, Apr 26, 2021, 2:54 PM Naveen Konduru  wrote:
>>>
>>> Hello Team ,
>>> I have oen requirement on Ansible with Hp ILO server..
>>>
>>> I am new to ansible.Need help  from you people.
>>> Requirement is
>>>  Have to  connect Hp ilo serverr using SSH and get SWId's details and  
>>> the out out  i have to display in csv file.. can any implementation pls do 
>>> let me know.
>>> Naveen
>>>
>>> On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com wrote:

 Please someone help me. I do not understand why i get this error. I can 
 ssh from my control node to this host and from the host to my control 
 node. But ansible test show this results.

 192.168.154.163 | UNREACHABLE! => {
 "changed": false,
 "msg": "Failed to connect to the host via ssh: con...@192.168.154.163: 
 Permission denied (publickey,password).",
 "unreachable": true

 this is my inventory:

 192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user

 Thank you

>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to ansible-proje...@googlegroups.com.
>>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/35390e98-0044-4ad8-8d91-a389e89604fdn%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/781d9d2e-6899-4057-9732-87320e54c53bn%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/CAHEKYV60Szx3r0%3D2c-ovVCjoxYz0j-GDDDRNhqtVnAAfk4bpJg%40mail.gmail.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread rebecca acheampong

I wish i could separate them as you have told me but i am very new to 
ansible and I am using it for my final project. I dont know how to do that. 
I changed the host to the target node's name. I think you are right because 
the localhost does the installation of the docker on the control node. But 
I do not know what to do.
On Monday, April 26, 2021 at 1:47:06 PM UTC+3 dick@geant.org wrote:

> You're using localhost as the target, which is OK for the vmware
> module (as that is an API based one), but then you also target
> localhost for the docker stuff.
> Split your deployment into separate playbook and make sure you're
> targeting the correct host.
> This may involve add_host etc.
>
> On Mon, 26 Apr 2021 at 12:21, rebecca acheampong  
> wrote:
> >
> > I am using ansible to install a docker but I get this error. How can i 
> solve this please?
> > Please help me, this installation has taken me a whole week
> >
> > Control node is ubuntu server 20.04
> > Target node is ubuntu desktop 18.04 on vmware esxi
> >
> > this is my playbook:
> > ---
> > - name: installing docker on ubuntu
> > hosts: localhost
> > remote_user: "{{ remote_user_name }}"
> > gather_facts: no
> > vars_files:
> > - var_docker.yml
> > vars:
> > remote_user_name: cyber01
> > apt_repo_data: "deb [arch=amd64]
> > https://download.docker.com/linux/ubuntu xenial stable"
> > apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
> > tasks:
> > - vmware_guest:
> > hostname: "{{ VMWARE_HOST }}"
> > username: "{{ VMWARE_USER }}"
> > password: "{{ VMWARE_PASSWORD }}"
> > validate_certs: no
> > folder: /ha-datacenter/vm/
> > name: my_vm_01
> > - name: adding docker gpg key
> > apt_key:
> > url: "{{ apt_gpg_key }}"
> > state: present
> > - name: add docker repository
> > apt_repository:
> > repo: "{{ apt_repo_data }}"
> > state: present
> > - name: installing docker-ce
> > apt:
> > name: docker-ce
> > state: present
> > update_cache: yes
> > - name: install python-pip
> > apt:
> > name: python-pip
> > state: present
> > - name: install docker-py
> > pip:
> > name: docker-py
> > state: present
> >
> > run playbook: ansible-playbook -i hosts docker_contairner.yml
> >
> > PLAY [installing docker on ubuntu] 
> *
> >
> > TASK [vmware_guest] 
> 
> > ok: [my_vm_01]
> >
> > TASK [adding docker gpg key] 
> ***
> > fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": 
> "/usr/bin/apt-key add -", "msg": "Warning: apt-key output should not be 
> parsed (stdout is not a terminal)\nE: This command can only be used by 
> root.", "rc": 1, "stderr": "Warning: apt-key output should not be parsed 
> (stdout is not a terminal)\nE: This command can only be used by root.\n", 
> "stderr_lines": ["Warning: apt-key output should not be parsed (stdout is 
> not a terminal)", "E: This command can only be used by root."], "stdout": 
> "", "stdout_lines": []}
> >
> > --
> > 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/ebd3bf51-8f39-40b3-b8bb-276bcaefa594n%40googlegroups.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread rebecca acheampong
I added become_user: true
   become_user_pass: true
I got the same error without the pass, but when i add the pass, i get this:
ERROR! 'become_user_pass' is not a valid attribute for a Play


On Monday, April 26, 2021 at 1:45:48 PM UTC+3 ng.duct...@gmail.com wrote:

> Sorry, it should be become: true
> By default it will elevate the account to root. You may need to pass 
> become_user_pass as well.
>
> Sent from my iPhone
>
> On 26 Apr 2021, at 18:30, rebecca acheampong  wrote:
>
> I just added become_user: root but the same problem
>
>
>
> On Monday, April 26, 2021 at 1:27:33 PM UTC+3 ng.duct...@gmail.com wrote:
>
>> Look like you need to add become_user option there
>>
>> Sent from my iPhone
>>
>> On 26 Apr 2021, at 18:21, rebecca acheampong  wrote:
>>
>> I am using ansible to install a docker but I get this error. How can i 
>> solve this please?
>>
>> Please help me, this installation has taken me a whole week
>>
>> Control node is ubuntu server 20.04
>> Target node is ubuntu desktop 18.04 on vmware esxi
>>
>> this is my playbook: 
>> ---
>> - name: installing docker on ubuntu
>>   hosts: localhost
>>   remote_user: "{{ remote_user_name }}"
>>   gather_facts: no
>>   vars_files:
>>  - var_docker.yml
>>   vars:
>>remote_user_name: cyber01
>>apt_repo_data: "deb [arch=amd64]
>>https://download.docker.com/linux/ubuntu xenial stable"
>>apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>>   tasks:
>> - vmware_guest:
>> hostname: "{{ VMWARE_HOST }}"
>> username: "{{ VMWARE_USER }}"
>> password: "{{ VMWARE_PASSWORD }}"
>> validate_certs: no
>> folder: /ha-datacenter/vm/
>> name: my_vm_01
>> - name: adding docker gpg key
>>   apt_key:
>> url: "{{ apt_gpg_key }}"
>> state: present
>> - name: add docker repository
>>   apt_repository:
>>repo: "{{ apt_repo_data }}"
>> state: present
>> - name: installing docker-ce
>>   apt:
>> name: docker-ce
>> state: present
>> update_cache: yes
>> - name: install python-pip
>>   apt:
>> name: python-pip
>> state: present
>> - name: install docker-py
>>   pip:
>> name: docker-py
>> state: present
>>
>> run playbook: ansible-playbook -i hosts docker_contairner.yml
>>
>> PLAY [installing docker on ubuntu] 
>> *
>>
>> TASK [vmware_guest] 
>> 
>> ok: [my_vm_01]
>>
>> TASK [adding docker gpg key] 
>> ***
>> fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key 
>> add -", "msg": "Warning: apt-key output should not be parsed (stdout is not 
>> a terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": 
>> "Warning: apt-key output should not be parsed (stdout is not a 
>> terminal)\nE: This command can only be used by root.\n", "stderr_lines": 
>> ["Warning: apt-key output should not be parsed (stdout is not a terminal)", 
>> "E: This command can only be used by root."], "stdout": "", "stdout_lines": 
>> []}
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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-proje...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/0eea9d03-612d-4608-b6cd-04cf044d1885n%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/a9cd9b78-2a84-48af-b02c-6227568ce1e7n%40googlegroups.com.


Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Hasini P
I am not executing playbook with sudo. Running it with my userID. Do you 
want me to paste - verbose output for more details here ? (I am using 
-K option with playbook and providing my 
password)

On Monday, 26 April 2021 at 16:11:30 UTC+5:30 ng.duct...@gmail.com wrote:

> Did you execute your playbook with sudo? If with sudo then you may need to 
> ssh copy key again for root account to target machine. And Can try to add 
> - then post the result?
>
> Sent from my iPhone
>
> On 26 Apr 2021, at 18:37, Hasini P  wrote:
>
> 
>
> yes, I am able to ping-pong with my userID.. ssh password-less 
> connectivity was established from control server to remote server with my ID
>
>
> On Monday, 26 April 2021 at 16:05:34 UTC+5:30 ng.duct...@gmail.com wrote:
>
>> Sorry, first of all, are you able to ping your server by ansible 
>> yourserver -m ping? Have you done to transfer your public key to client?
>>
>> Sent from my iPhone
>>
>> On 26 Apr 2021, at 18:32, Hasini P  wrote:
>>
>> Thanks, I tried different possibilities including your suggestion as 
>> below., but it didnt work
>>
>>
>> ---
>> - name: test
>>   hosts: all 
>>   tasks:
>>   - name: sample shell task to check the userID
>> shell: echo `whoami`
>> become: yes
>>
>> On Monday, 26 April 2021 at 15:59:20 UTC+5:30 ng.duct...@gmail.com wrote:
>>
>>> I think just become_user: yes may solve your issue.
>>>
>>> Sent from my iPhone
>>>
>>> On 26 Apr 2021, at 18:26, Hasini P  wrote:
>>>
>>> 
>>>
>>>
>>> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
>>> ansible on our control node. 
>>> I am facing error when trying to perform ping-pong with ansible as 
>>> become_user root (as pasted below). On the remote server, the user is 
>>> having access to run sudo commands and user can become root by running sudo 
>>> su -  
>>>  (with become disabled, connection is working fine to any remote_user)
>>>  
>>> Error ---_> 
>>> 1x.xx.xxx.xx | FAILED! => {
>>> "ansible_facts": {
>>> "discovered_interpreter_python": "/usr/bin/python"
>>> },
>>> "changed": false,
>>> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
>>> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
>>> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
>>> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
>>> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
>>> request forwardings: 0 local, 0 remote\r\ndebug3: 
>>> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
>>> entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
>>> mux_client_request_session: session request sent\r\ndebug1: 
>>> mux_client_request_session: master session id: 2\r\ndebug3: 
>>> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
>>> exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
>>> "module_stdout": "",
>>> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
>>> "rc": 1
>>>  
>>> I have used the below privilege escalation and tried ssh_connection 
>>> parameters in ansible config file
>>> [privilege_escalation]
>>> become=True
>>> become_method=sudo
>>> become_user=root
>>> become_ask_pass=True
>>>  
>>> [ssh_connection]
>>> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
>>> pipelining=False
>>>
>>> 
>>> On remote server, we have 2.7.5 version of python
>>> python3 --version
>>> -bash: python3: command not found
>>> $ python --version
>>> Python 2.7.5
>>> $ which python
>>> /bin/python
>>> sudo which python
>>> SUDO requires you to enter your login password :
>>> /bin/python
>>>
>>> Thanks
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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-proje...@googlegroups.com.
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/98908b1a-44f0-4ab7-859e-c44fb6c36bbbn%40googlegroups.com
>>  
>> 
>> .
>>
>> -- 
> You received this message 

Re: [ansible-project] docker installation problems

2021-04-26 Thread Dick Visser
You're using localhost as the target, which is OK for the vmware
module (as that is an API based one), but then you also target
localhost for the docker stuff.
Split your deployment into separate playbook and make sure you're
targeting the correct host.
This may involve add_host etc.

On Mon, 26 Apr 2021 at 12:21, rebecca acheampong  wrote:
>
> I am using ansible to install a docker but I get this error. How can i solve 
> this please?
> Please help me, this installation has taken me a whole week
>
> Control node is ubuntu server 20.04
> Target node is ubuntu desktop 18.04 on vmware esxi
>
> this is my playbook:
> ---
> - name: installing docker on ubuntu
>   hosts: localhost
>   remote_user: "{{ remote_user_name }}"
>   gather_facts: no
>   vars_files:
>  - var_docker.yml
>   vars:
>remote_user_name: cyber01
>apt_repo_data: "deb [arch=amd64]
>https://download.docker.com/linux/ubuntu xenial stable"
>apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>   tasks:
> - vmware_guest:
> hostname: "{{ VMWARE_HOST }}"
> username: "{{ VMWARE_USER }}"
> password: "{{ VMWARE_PASSWORD }}"
> validate_certs: no
> folder: /ha-datacenter/vm/
> name: my_vm_01
> - name: adding docker gpg key
>   apt_key:
> url: "{{ apt_gpg_key }}"
> state: present
> - name: add docker repository
>   apt_repository:
>repo: "{{ apt_repo_data }}"
> state: present
> - name: installing docker-ce
>   apt:
> name: docker-ce
> state: present
> update_cache: yes
> - name: install python-pip
>   apt:
> name: python-pip
> state: present
> - name: install docker-py
>   pip:
> name: docker-py
> state: present
>
> run playbook: ansible-playbook -i hosts docker_contairner.yml
>
> PLAY [installing docker on ubuntu] 
> *
>
> TASK [vmware_guest] 
> 
> ok: [my_vm_01]
>
> TASK [adding docker gpg key] 
> ***
> fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key add 
> -", "msg": "Warning: apt-key output should not be parsed (stdout is not a 
> terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": 
> "Warning: apt-key output should not be parsed (stdout is not a terminal)\nE: 
> This command can only be used by root.\n", "stderr_lines": ["Warning: apt-key 
> output should not be parsed (stdout is not a terminal)", "E: This command can 
> only be used by root."], "stdout": "", "stdout_lines": []}
>
> --
> 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/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/CAL8fbwMKC6HAVBJV8-Hz-W8gLQt5uhW3VDSA7fsvfdKK%2BA01hQ%40mail.gmail.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread Thanh Nguyen Duc
Sorry, it should be become: true
By default it will elevate the account to root. You may need to pass 
become_user_pass as well.

Sent from my iPhone

> On 26 Apr 2021, at 18:30, rebecca acheampong  wrote:
> 
> I just added become_user: root but the same problem
> 
>> On Monday, April 26, 2021 at 1:27:33 PM UTC+3 ng.duct...@gmail.com wrote:
>> Look like you need to add become_user option there
>> 
>> Sent from my iPhone
>> 
 On 26 Apr 2021, at 18:21, rebecca acheampong  wrote:
 
>>> I am using ansible to install a docker but I get this error. How can i 
>>> solve this please?
>> 
>>> Please help me, this installation has taken me a whole week
>>> 
>>> Control node is ubuntu server 20.04
>>> Target node is ubuntu desktop 18.04 on vmware esxi
>>> 
>>> this is my playbook: 
>>> ---
>>> - name: installing docker on ubuntu
>>>   hosts: localhost
>>>   remote_user: "{{ remote_user_name }}"
>>>   gather_facts: no
>>>   vars_files:
>>>  - var_docker.yml
>>>   vars:
>>>remote_user_name: cyber01
>>>apt_repo_data: "deb [arch=amd64]
>>>https://download.docker.com/linux/ubuntu xenial stable"
>>>apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>>>   tasks:
>>> - vmware_guest:
>>> hostname: "{{ VMWARE_HOST }}"
>>> username: "{{ VMWARE_USER }}"
>>> password: "{{ VMWARE_PASSWORD }}"
>>> validate_certs: no
>>> folder: /ha-datacenter/vm/
>>> name: my_vm_01
>>> - name: adding docker gpg key
>>>   apt_key:
>>> url: "{{ apt_gpg_key }}"
>>> state: present
>>> - name: add docker repository
>>>   apt_repository:
>>>repo: "{{ apt_repo_data }}"
>>> state: present
>>> - name: installing docker-ce
>>>   apt:
>>> name: docker-ce
>>> state: present
>>> update_cache: yes
>>> - name: install python-pip
>>>   apt:
>>> name: python-pip
>>> state: present
>>> - name: install docker-py
>>>   pip:
>>> name: docker-py
>>> state: present
>>> 
>>> run playbook: ansible-playbook -i hosts docker_contairner.yml
>>> 
>>> PLAY [installing docker on ubuntu] 
>>> *
>>> 
>>> TASK [vmware_guest] 
>>> 
>>> ok: [my_vm_01]
>>> 
>>> TASK [adding docker gpg key] 
>>> ***
>>> fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key 
>>> add -", "msg": "Warning: apt-key output should not be parsed (stdout is not 
>>> a terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": 
>>> "Warning: apt-key output should not be parsed (stdout is not a 
>>> terminal)\nE: This command can only be used by root.\n", "stderr_lines": 
>>> ["Warning: apt-key output should not be parsed (stdout is not a terminal)", 
>>> "E: This command can only be used by root."], "stdout": "", "stdout_lines": 
>>> []}
>>> 
>> 
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/0eea9d03-612d-4608-b6cd-04cf044d1885n%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/AA7D7F8F-A159-4A79-83B4-AF7C2D469FD3%40gmail.com.


Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Thanh Nguyen Duc
Did you execute your playbook with sudo? If with sudo then you may need to ssh 
copy key again for root account to target machine. And Can try to add - 
then post the result?

Sent from my iPhone

> On 26 Apr 2021, at 18:37, Hasini P  wrote:
> 
> 
> yes, I am able to ping-pong with my userID.. ssh password-less connectivity 
> was established from control server to remote server with my ID
> 
> 
>> On Monday, 26 April 2021 at 16:05:34 UTC+5:30 ng.duct...@gmail.com wrote:
>> Sorry, first of all, are you able to ping your server by ansible yourserver 
>> -m ping? Have you done to transfer your public key to client?
>> 
>> Sent from my iPhone
>> 
 On 26 Apr 2021, at 18:32, Hasini P  wrote:
 
>>> Thanks, I tried different possibilities including your suggestion as 
>>> below., but it didnt work
>> 
>>> 
>>> ---
>>> - name: test
>>>   hosts: all 
>>>   tasks:
>>>   - name: sample shell task to check the userID
>>> shell: echo `whoami`
>>> become: yes
>>> 
 On Monday, 26 April 2021 at 15:59:20 UTC+5:30 ng.duct...@gmail.com wrote:
 I think just become_user: yes may solve your issue.
 
 Sent from my iPhone
 
>> On 26 Apr 2021, at 18:26, Hasini P  wrote:
>> 
> 
 
> 
> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
> ansible on our control node. 
> I am facing error when trying to perform ping-pong with ansible as 
> become_user root (as pasted below). On the remote server, the user is 
> having access to run sudo commands and user can become root by running 
> sudo su -  
>  (with become disabled, connection is working fine to any remote_user)
>  
> Error ---_> 
> 1x.xx.xxx.xx | FAILED! => {
> "ansible_facts": {
> "discovered_interpreter_python": "/usr/bin/python"
> },
> "changed": false,
> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
> mux_client_hello_exchange: master version 4\r\ndebug3: 
> mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: 
> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
> entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
> mux_client_request_session: session request sent\r\ndebug1: 
> mux_client_request_session: master session id: 2\r\ndebug3: 
> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: 
> Received exit status from master 1\r\nShared connection to 1x.xx.xxx.xx 
> closed.\r\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
> "rc": 1
>  
> I have used the below privilege escalation and tried ssh_connection 
> parameters in ansible config file
> [privilege_escalation]
> become=True
> become_method=sudo
> become_user=root
> become_ask_pass=True
>  
> [ssh_connection]
> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
> pipelining=False
> 
> On remote server, we have 2.7.5 version of python
> python3 --version
> -bash: python3: command not found
> $ python --version
> Python 2.7.5
> $ which python
> /bin/python
> sudo which python
> SUDO requires you to enter your login password :
> /bin/python
> 
> Thanks
 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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-proje...@googlegroups.com.
>> 
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/98908b1a-44f0-4ab7-859e-c44fb6c36bbbn%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/9da37eca-0cd5-4a2a-ae8f-1523fda3a382n%40googlegroups.com.

-- 
You received this message because you are subscribed to 

Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Hasini P
yes, I am able to ping-pong with my userID.. ssh password-less connectivity 
was established from control server to remote server with my ID


On Monday, 26 April 2021 at 16:05:34 UTC+5:30 ng.duct...@gmail.com wrote:

> Sorry, first of all, are you able to ping your server by ansible 
> yourserver -m ping? Have you done to transfer your public key to client?
>
> Sent from my iPhone
>
> On 26 Apr 2021, at 18:32, Hasini P  wrote:
>
> Thanks, I tried different possibilities including your suggestion as 
> below., but it didnt work
>
>
> ---
> - name: test
>   hosts: all 
>   tasks:
>   - name: sample shell task to check the userID
> shell: echo `whoami`
> become: yes
>
> On Monday, 26 April 2021 at 15:59:20 UTC+5:30 ng.duct...@gmail.com wrote:
>
>> I think just become_user: yes may solve your issue.
>>
>> Sent from my iPhone
>>
>> On 26 Apr 2021, at 18:26, Hasini P  wrote:
>>
>> 
>>
>>
>> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
>> ansible on our control node. 
>> I am facing error when trying to perform ping-pong with ansible as 
>> become_user root (as pasted below). On the remote server, the user is 
>> having access to run sudo commands and user can become root by running sudo 
>> su -  
>>  (with become disabled, connection is working fine to any remote_user)
>>  
>> Error ---_> 
>> 1x.xx.xxx.xx | FAILED! => {
>> "ansible_facts": {
>> "discovered_interpreter_python": "/usr/bin/python"
>> },
>> "changed": false,
>> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
>> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
>> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
>> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
>> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
>> request forwardings: 0 local, 0 remote\r\ndebug3: 
>> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
>> entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
>> mux_client_request_session: session request sent\r\ndebug1: 
>> mux_client_request_session: master session id: 2\r\ndebug3: 
>> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
>> exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
>> "module_stdout": "",
>> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
>> "rc": 1
>>  
>> I have used the below privilege escalation and tried ssh_connection 
>> parameters in ansible config file
>> [privilege_escalation]
>> become=True
>> become_method=sudo
>> become_user=root
>> become_ask_pass=True
>>  
>> [ssh_connection]
>> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
>> pipelining=False
>>
>> 
>> On remote server, we have 2.7.5 version of python
>> python3 --version
>> -bash: python3: command not found
>> $ python --version
>> Python 2.7.5
>> $ which python
>> /bin/python
>> sudo which python
>> SUDO requires you to enter your login password :
>> /bin/python
>>
>> Thanks
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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-proje...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/98908b1a-44f0-4ab7-859e-c44fb6c36bbbn%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/9da37eca-0cd5-4a2a-ae8f-1523fda3a382n%40googlegroups.com.


Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Thanh Nguyen Duc
Sorry, first of all, are you able to ping your server by ansible yourserver -m 
ping? Have you done to transfer your public key to client?

Sent from my iPhone

> On 26 Apr 2021, at 18:32, Hasini P  wrote:
> 
> Thanks, I tried different possibilities including your suggestion as below., 
> but it didnt work
> ---
> - name: test
>   hosts: all 
>   tasks:
>   - name: sample shell task to check the userID
> shell: echo `whoami`
> become: yes
> 
>> On Monday, 26 April 2021 at 15:59:20 UTC+5:30 ng.duct...@gmail.com wrote:
>> I think just become_user: yes may solve your issue.
>> 
>> Sent from my iPhone
>> 
 On 26 Apr 2021, at 18:26, Hasini P  wrote:
 
>>> 
>> 
>>> 
>>> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
>>> ansible on our control node. 
>>> I am facing error when trying to perform ping-pong with ansible as 
>>> become_user root (as pasted below). On the remote server, the user is 
>>> having access to run sudo commands and user can become root by running sudo 
>>> su -  
>>>  (with become disabled, connection is working fine to any remote_user)
>>>  
>>> Error ---_> 
>>> 1x.xx.xxx.xx | FAILED! => {
>>> "ansible_facts": {
>>> "discovered_interpreter_python": "/usr/bin/python"
>>> },
>>> "changed": false,
>>> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
>>> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
>>> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
>>> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
>>> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
>>> request forwardings: 0 local, 0 remote\r\ndebug3: 
>>> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
>>> entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
>>> mux_client_request_session: session request sent\r\ndebug1: 
>>> mux_client_request_session: master session id: 2\r\ndebug3: 
>>> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
>>> exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
>>> "module_stdout": "",
>>> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
>>> "rc": 1
>>>  
>>> I have used the below privilege escalation and tried ssh_connection 
>>> parameters in ansible config file
>>> [privilege_escalation]
>>> become=True
>>> become_method=sudo
>>> become_user=root
>>> become_ask_pass=True
>>>  
>>> [ssh_connection]
>>> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
>>> pipelining=False
>>> 
>>> On remote server, we have 2.7.5 version of python
>>> python3 --version
>>> -bash: python3: command not found
>>> $ python --version
>>> Python 2.7.5
>>> $ which python
>>> /bin/python
>>> sudo which python
>>> SUDO requires you to enter your login password :
>>> /bin/python
>>> 
>>> Thanks
>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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/98908b1a-44f0-4ab7-859e-c44fb6c36bbbn%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/E9FC98B7-5A44-44E0-9DCB-2338B9D21D28%40gmail.com.


Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Hasini P
Thanks, I tried different possibilities including your suggestion as 
below., but it didnt work
---
- name: test
  hosts: all 
  tasks:
  - name: sample shell task to check the userID
shell: echo `whoami`
become: yes

On Monday, 26 April 2021 at 15:59:20 UTC+5:30 ng.duct...@gmail.com wrote:

> I think just become_user: yes may solve your issue.
>
> Sent from my iPhone
>
> On 26 Apr 2021, at 18:26, Hasini P  wrote:
>
> 
>
>
> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
> ansible on our control node. 
> I am facing error when trying to perform ping-pong with ansible as 
> become_user root (as pasted below). On the remote server, the user is 
> having access to run sudo commands and user can become root by running sudo 
> su -  
>  (with become disabled, connection is working fine to any remote_user)
>  
> Error ---_> 
> 1x.xx.xxx.xx | FAILED! => {
> "ansible_facts": {
> "discovered_interpreter_python": "/usr/bin/python"
> },
> "changed": false,
> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
> request forwardings: 0 local, 0 remote\r\ndebug3: 
> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
> entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
> mux_client_request_session: session request sent\r\ndebug1: 
> mux_client_request_session: master session id: 2\r\ndebug3: 
> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
> exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
> "rc": 1
>  
> I have used the below privilege escalation and tried ssh_connection 
> parameters in ansible config file
> [privilege_escalation]
> become=True
> become_method=sudo
> become_user=root
> become_ask_pass=True
>  
> [ssh_connection]
> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
> pipelining=False
>
> 
> On remote server, we have 2.7.5 version of python
> python3 --version
> -bash: python3: command not found
> $ python --version
> Python 2.7.5
> $ which python
> /bin/python
> sudo which python
> SUDO requires you to enter your login password :
> /bin/python
>
> Thanks
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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/98908b1a-44f0-4ab7-859e-c44fb6c36bbbn%40googlegroups.com.


Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Thanh Nguyen Duc
Sorry, just become: true may solve, by default it always become root already

Sent from my iPhone

> On 26 Apr 2021, at 18:29, Thanh Nguyen Duc  wrote:
> 
> I think just become_user: yes may solve your issue.
> 
> Sent from my iPhone
> 
>>> On 26 Apr 2021, at 18:26, Hasini P  wrote:
>>> 
>> 
>> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
>> ansible on our control node. 
>> I am facing error when trying to perform ping-pong with ansible as 
>> become_user root (as pasted below). On the remote server, the user is having 
>> access to run sudo commands and user can become root by running sudo su -  
>>  (with become disabled, connection is working fine to any remote_user)
>>  
>> Error ---_> 
>> 1x.xx.xxx.xx | FAILED! => {
>> "ansible_facts": {
>> "discovered_interpreter_python": "/usr/bin/python"
>> },
>> "changed": false,
>> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
>> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
>> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
>> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
>> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
>> request forwardings: 0 local, 0 remote\r\ndebug3: 
>> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
>> entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
>> mux_client_request_session: session request sent\r\ndebug1: 
>> mux_client_request_session: master session id: 2\r\ndebug3: 
>> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
>> exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
>> "module_stdout": "",
>> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
>> "rc": 1
>>  
>> I have used the below privilege escalation and tried ssh_connection 
>> parameters in ansible config file
>> [privilege_escalation]
>> become=True
>> become_method=sudo
>> become_user=root
>> become_ask_pass=True
>>  
>> [ssh_connection]
>> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
>> pipelining=False
>> 
>> On remote server, we have 2.7.5 version of python
>> python3 --version
>> -bash: python3: command not found
>> $ python --version
>> Python 2.7.5
>> $ which python
>> /bin/python
>> sudo which python
>> SUDO requires you to enter your login password :
>> /bin/python
>> 
>> Thanks
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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/91B09FE0-637E-4B3E-A40D-41251F5807E0%40gmail.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread rebecca acheampong
I just added become_user: root but the same problem

On Monday, April 26, 2021 at 1:27:33 PM UTC+3 ng.duct...@gmail.com wrote:

> Look like you need to add become_user option there
>
> Sent from my iPhone
>
> On 26 Apr 2021, at 18:21, rebecca acheampong  wrote:
>
> I am using ansible to install a docker but I get this error. How can i 
> solve this please?
>
> Please help me, this installation has taken me a whole week
>
> Control node is ubuntu server 20.04
> Target node is ubuntu desktop 18.04 on vmware esxi
>
> this is my playbook: 
> ---
> - name: installing docker on ubuntu
>   hosts: localhost
>   remote_user: "{{ remote_user_name }}"
>   gather_facts: no
>   vars_files:
>  - var_docker.yml
>   vars:
>remote_user_name: cyber01
>apt_repo_data: "deb [arch=amd64]
>https://download.docker.com/linux/ubuntu xenial stable"
>apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>   tasks:
> - vmware_guest:
> hostname: "{{ VMWARE_HOST }}"
> username: "{{ VMWARE_USER }}"
> password: "{{ VMWARE_PASSWORD }}"
> validate_certs: no
> folder: /ha-datacenter/vm/
> name: my_vm_01
> - name: adding docker gpg key
>   apt_key:
> url: "{{ apt_gpg_key }}"
> state: present
> - name: add docker repository
>   apt_repository:
>repo: "{{ apt_repo_data }}"
> state: present
> - name: installing docker-ce
>   apt:
> name: docker-ce
> state: present
> update_cache: yes
> - name: install python-pip
>   apt:
> name: python-pip
> state: present
> - name: install docker-py
>   pip:
> name: docker-py
> state: present
>
> run playbook: ansible-playbook -i hosts docker_contairner.yml
>
> PLAY [installing docker on ubuntu] 
> *
>
> TASK [vmware_guest] 
> 
> ok: [my_vm_01]
>
> TASK [adding docker gpg key] 
> ***
> fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key 
> add -", "msg": "Warning: apt-key output should not be parsed (stdout is not 
> a terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": 
> "Warning: apt-key output should not be parsed (stdout is not a 
> terminal)\nE: This command can only be used by root.\n", "stderr_lines": 
> ["Warning: apt-key output should not be parsed (stdout is not a terminal)", 
> "E: This command can only be used by root."], "stdout": "", "stdout_lines": 
> []}
>
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/0eea9d03-612d-4608-b6cd-04cf044d1885n%40googlegroups.com.


Re: [ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Thanh Nguyen Duc
I think just become_user: yes may solve your issue.

Sent from my iPhone

> On 26 Apr 2021, at 18:26, Hasini P  wrote:
> 
> 
> Team,  Can someone sort this out please.. We are using 2.8.18 version of 
> ansible on our control node. 
> I am facing error when trying to perform ping-pong with ansible as 
> become_user root (as pasted below). On the remote server, the user is having 
> access to run sudo commands and user can become root by running sudo su -  
>  (with become disabled, connection is working fine to any remote_user)
>  
> Error ---_> 
> 1x.xx.xxx.xx | FAILED! => {
> "ansible_facts": {
> "discovered_interpreter_python": "/usr/bin/python"
> },
> "changed": false,
> "module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
> 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
> /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
> Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
> request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: 
> entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: 
> mux_client_request_alive: done pid = 31364\r\ndebug3: 
> mux_client_request_session: session request sent\r\ndebug1: 
> mux_client_request_session: master session id: 2\r\ndebug3: 
> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
> exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
> "rc": 1
>  
> I have used the below privilege escalation and tried ssh_connection 
> parameters in ansible config file
> [privilege_escalation]
> become=True
> become_method=sudo
> become_user=root
> become_ask_pass=True
>  
> [ssh_connection]
> ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
> pipelining=False
> 
> On remote server, we have 2.7.5 version of python
> python3 --version
> -bash: python3: command not found
> $ python --version
> Python 2.7.5
> $ which python
> /bin/python
> sudo which python
> SUDO requires you to enter your login password :
> /bin/python
> 
> Thanks
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%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/E167C2F4-644F-4FA2-928B-F91B020678F5%40gmail.com.


Re: [ansible-project] docker installation problems

2021-04-26 Thread Thanh Nguyen Duc
Look like you need to add become_user option there

Sent from my iPhone

> On 26 Apr 2021, at 18:21, rebecca acheampong  wrote:
> 
> I am using ansible to install a docker but I get this error. How can i solve 
> this please?
> Please help me, this installation has taken me a whole week
> 
> Control node is ubuntu server 20.04
> Target node is ubuntu desktop 18.04 on vmware esxi
> 
> this is my playbook: 
> ---
> - name: installing docker on ubuntu
>   hosts: localhost
>   remote_user: "{{ remote_user_name }}"
>   gather_facts: no
>   vars_files:
>  - var_docker.yml
>   vars:
>remote_user_name: cyber01
>apt_repo_data: "deb [arch=amd64]
>https://download.docker.com/linux/ubuntu xenial stable"
>apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
>   tasks:
> - vmware_guest:
> hostname: "{{ VMWARE_HOST }}"
> username: "{{ VMWARE_USER }}"
> password: "{{ VMWARE_PASSWORD }}"
> validate_certs: no
> folder: /ha-datacenter/vm/
> name: my_vm_01
> - name: adding docker gpg key
>   apt_key:
> url: "{{ apt_gpg_key }}"
> state: present
> - name: add docker repository
>   apt_repository:
>  repo: "{{ apt_repo_data }}"
> state: present
> - name: installing docker-ce
>   apt:
> name: docker-ce
> state: present
> update_cache: yes
> - name: install python-pip
>   apt:
> name: python-pip
> state: present
> - name: install docker-py
>   pip:
> name: docker-py
> state: present
> 
> run playbook: ansible-playbook -i hosts docker_contairner.yml
> 
> PLAY [installing docker on ubuntu] 
> *
> 
> TASK [vmware_guest] 
> 
> ok: [my_vm_01]
> 
> TASK [adding docker gpg key] 
> ***
> fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key add 
> -", "msg": "Warning: apt-key output should not be parsed (stdout is not a 
> terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": 
> "Warning: apt-key output should not be parsed (stdout is not a terminal)\nE: 
> This command can only be used by root.\n", "stderr_lines": ["Warning: apt-key 
> output should not be parsed (stdout is not a terminal)", "E: This command can 
> only be used by root."], "stdout": "", "stdout_lines": []}
> 
> -- 
> 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/eac60358-57e0-4f9f-ad03-377ec881f6e2n%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/E99A3916-3584-401F-874D-210A83FEE7C2%40gmail.com.


[ansible-project] Facing issues with ssh connection as user root

2021-04-26 Thread Hasini P

Team,  Can someone sort this out please.. We are using 2.8.18 version of 
ansible on our control node. 
I am facing error when trying to perform ping-pong with ansible as 
become_user root (as pasted below). On the remote server, the user is 
having access to run sudo commands and user can become root by running sudo 
su -  
 (with become disabled, connection is working fine to any remote_user)
 
Error ---_> 
1x.xx.xxx.xx | FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 
2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
/etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: 
Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: 
mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
request forwardings: 0 local, 0 remote\r\ndebug3: 
mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
entering\r\ndebug3: mux_client_request_alive: done pid = 31364\r\ndebug3: 
mux_client_request_session: session request sent\r\ndebug1: 
mux_client_request_session: master session id: 2\r\ndebug3: 
mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
exit status from master 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
 
I have used the below privilege escalation and tried ssh_connection 
parameters in ansible config file
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=True
 
[ssh_connection]
ssh_args='-C -o ControlMaster=auto -o ControlPersist=60s'
pipelining=False

On remote server, we have 2.7.5 version of python
python3 --version
-bash: python3: command not found
$ python --version
Python 2.7.5
$ which python
/bin/python
sudo which python
SUDO requires you to enter your login password :
/bin/python

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f3f80daf-fd7c-47b8-8950-704d8f6d4762n%40googlegroups.com.


[ansible-project] docker installation problems

2021-04-26 Thread rebecca acheampong
I am using ansible to install a docker but I get this error. How can i 
solve this please?
Please help me, this installation has taken me a whole week

Control node is ubuntu server 20.04
Target node is ubuntu desktop 18.04 on vmware esxi

this is my playbook: 
---
- name: installing docker on ubuntu
  hosts: localhost
  remote_user: "{{ remote_user_name }}"
  gather_facts: no
  vars_files:
 - var_docker.yml
  vars:
   remote_user_name: cyber01
   apt_repo_data: "deb [arch=amd64]
   https://download.docker.com/linux/ubuntu xenial stable"
   apt_gpg_key: https://download.docker.com/linux/ubuntu/gpg
  tasks:
- vmware_guest:
hostname: "{{ VMWARE_HOST }}"
username: "{{ VMWARE_USER }}"
password: "{{ VMWARE_PASSWORD }}"
validate_certs: no
folder: /ha-datacenter/vm/
name: my_vm_01
- name: adding docker gpg key
  apt_key:
url: "{{ apt_gpg_key }}"
state: present
- name: add docker repository
  apt_repository:
   repo: "{{ apt_repo_data }}"
state: present
- name: installing docker-ce
  apt:
name: docker-ce
state: present
update_cache: yes
- name: install python-pip
  apt:
name: python-pip
state: present
- name: install docker-py
  pip:
name: docker-py
state: present

run playbook: ansible-playbook -i hosts docker_contairner.yml

PLAY [installing docker on ubuntu] 
*

TASK [vmware_guest] 

ok: [my_vm_01]

TASK [adding docker gpg key] 
***
fatal: [my_vm_01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key 
add -", "msg": "Warning: apt-key output should not be parsed (stdout is not 
a terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": 
"Warning: apt-key output should not be parsed (stdout is not a 
terminal)\nE: This command can only be used by root.\n", "stderr_lines": 
["Warning: apt-key output should not be parsed (stdout is not a terminal)", 
"E: This command can only be used by root."], "stdout": "", "stdout_lines": 
[]}

-- 
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/eac60358-57e0-4f9f-ad03-377ec881f6e2n%40googlegroups.com.


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread Komal Suthar
 template:
 src : file.txt

Inside this file.txt..
 The default IPv4 address of {{ ansible_facts.fqdn }}
 is {{ ansible_facts.default_ipv4.address }}

dest : file.csv

Some facts example there are lots of facts related to that server you have
to fetch or serch in docs

On Mon, Apr 26, 2021, 3:30 PM Naveen Konduru  wrote:

> do u have any sample code  ...if u have pls share with me
>
> On Monday, April 26, 2021 at 3:28:21 PM UTC+5:30 komalsuth...@gmail.com
> wrote:
>
>> You can use jinja templates for getting the facts of the server and use
>> template modules for creating your file.
>>
>> On Mon, Apr 26, 2021, 2:54 PM Naveen Konduru  wrote:
>>
>>> Hello Team ,
>>> I have oen requirement on Ansible with Hp ILO server..
>>>
>>> I am new to ansible.Need help  from you people.
>>> Requirement is
>>>  Have to  connect Hp ilo serverr using SSH and get SWId's details
>>> and  the out out  i have to display in csv file.. can any implementation
>>> pls do let me know.
>>> Naveen
>>>
>>> On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com
>>> wrote:
>>>
 Please someone help me. I do not understand why i get this error. I can
 ssh from my control node to this host and from the host to my control node.
 But ansible test show this results.

 192.168.154.163 | UNREACHABLE! => {
 "changed": false,
 "msg": "Failed to connect to the host via ssh:
 con...@192.168.154.163: Permission denied (publickey,password).",
 "unreachable": true

 this is my inventory:

 192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user

 Thank you

 --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ansible-proje...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/35390e98-0044-4ad8-8d91-a389e89604fdn%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/781d9d2e-6899-4057-9732-87320e54c53bn%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/CAGgS%3DuV7e9WhVJjK%2BM5rBhrUQdu9%2BOhj81yx_UF1S2qLuKwtkA%40mail.gmail.com.


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread Naveen Konduru
do u have any sample code  ...if u have pls share with me 

On Monday, April 26, 2021 at 3:28:21 PM UTC+5:30 komalsuth...@gmail.com 
wrote:

> You can use jinja templates for getting the facts of the server and use 
> template modules for creating your file.
>
> On Mon, Apr 26, 2021, 2:54 PM Naveen Konduru  wrote:
>
>> Hello Team ,
>> I have oen requirement on Ansible with Hp ILO server..
>>
>> I am new to ansible.Need help  from you people.
>> Requirement is 
>>  Have to  connect Hp ilo serverr using SSH and get SWId's details 
>> and  the out out  i have to display in csv file.. can any implementation 
>> pls do let me know.
>> Naveen
>>
>> On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com wrote:
>>
>>> Please someone help me. I do not understand why i get this error. I can 
>>> ssh from my control node to this host and from the host to my control node. 
>>> But ansible test show this results.
>>>
>>> 192.168.154.163 | UNREACHABLE! => {
>>> "changed": false,
>>> "msg": "Failed to connect to the host via ssh: 
>>> con...@192.168.154.163: Permission denied (publickey,password).",
>>> "unreachable": true
>>>
>>> this is my inventory:
>>>
>>> 192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user
>>>
>>> Thank you
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/35390e98-0044-4ad8-8d91-a389e89604fdn%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/781d9d2e-6899-4057-9732-87320e54c53bn%40googlegroups.com.


Re: [ansible-project] Modifying CIDR of an existing EC2 Security Groups using Ansible

2021-04-26 Thread Komal Suthar
In this ec2_group module i don't think that we can solve this use case

On Mon, Apr 26, 2021, 11:04 AM Naveen NK  wrote:

> Can we modify existing EC2 Security group using Ansible by accepting new
> input parameter through jenkins job?
>
> Scenario - I have to update users public IP to Ec2 security groups
> everyday Whenever their Public ip changes. This become repetitive tasks as
> Public IP is dynamic and changes everyday. I tried to automate this by
> creating ansible playbook with jenkins job by passing input parameter *"{{
> newpublicip }}"* for new public ip and let user provide his IP and run
> the job and it updates the security groups. Below is the code
> - hosts: localhost
> connection: local
> gather_facts: false
>
> vars:
> - newpublicip: "{{ newpublicip }}"
> - name: "{{ name }}"
>
>
> tasks:
> - name: boto3
> pip:
> name: "boto3"
> state: present
>
> - name: modiying security group
> ec2_group:
> name: "{{ name }}"
> description: An example ec2 group
> vpc_id: 
> region: "{{ region }}"
> aws_access_key: "{{ access_key }}"
> aws_secret_key: "{{ secret_key }}"
> rules:
> - proto: tcp
> from_port: 80
> to_port: 80
> cidr_ip: "0.0.0.0/0"
> - proto: tcp
> from_port: 22
> to_port: 22
> cidr_ip: "{{ newpublicip }}"
> rule_desc: user1
> - proto: tcp
> from_port: 22
> to_port: 22
> cidr_ip: "{{ newpublicip }}"
> rule_desc: user2
>
> But the problem here is it updates whole existing security group with
> passed value, Here we will have different users assigned same port numbers
> with their public IP as source to access, so based on matching the
> rule_desc ex., user1 it should update the CIDR ip with input value provided 
> *"{{
> newpublicip }}"* Or please suggest some options to improvise this?
>
> Thank you !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7a7674af-d06c-4043-a67f-51532da62c38n%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/CAGgS%3DuWzVQbpA5TAbxbWGw6CSqheuA70OENqp4QJEKP7ZxjyAw%40mail.gmail.com.


Re: [ansible-project] Re: ansible ssh connections

2021-04-26 Thread Komal Suthar
You can use jinja templates for getting the facts of the server and use
template modules for creating your file.

On Mon, Apr 26, 2021, 2:54 PM Naveen Konduru  wrote:

> Hello Team ,
> I have oen requirement on Ansible with Hp ILO server..
>
> I am new to ansible.Need help  from you people.
> Requirement is
>  Have to  connect Hp ilo serverr using SSH and get SWId's details and
> the out out  i have to display in csv file.. can any implementation pls do
> let me know.
> Naveen
>
> On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com wrote:
>
>> Please someone help me. I do not understand why i get this error. I can
>> ssh from my control node to this host and from the host to my control node.
>> But ansible test show this results.
>>
>> 192.168.154.163 | UNREACHABLE! => {
>> "changed": false,
>> "msg": "Failed to connect to the host via ssh: con...@192.168.154.163:
>> Permission denied (publickey,password).",
>> "unreachable": true
>>
>> this is my inventory:
>>
>> 192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user
>>
>> Thank you
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/35390e98-0044-4ad8-8d91-a389e89604fdn%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/CAGgS%3DuVAESu%3Dr-VWzKtZz-YHUYQ4e%2Burf1dghGVmjoe_KAwdYQ%40mail.gmail.com.


[ansible-project] Re: ansible ssh connections

2021-04-26 Thread Naveen Konduru
Hello Team ,
I have oen requirement on Ansible with Hp ILO server..

I am new to ansible.Need help  from you people.
Requirement is 
 Have to  connect Hp ilo serverr using SSH and get SWId's details and  
the out out  i have to display in csv file.. can any implementation pls do 
let me know.
Naveen

On Friday, April 23, 2021 at 9:05:14 PM UTC+5:30 bec1...@gmail.com wrote:

> Please someone help me. I do not understand why i get this error. I can 
> ssh from my control node to this host and from the host to my control node. 
> But ansible test show this results.
>
> 192.168.154.163 | UNREACHABLE! => {
> "changed": false,
> "msg": "Failed to connect to the host via ssh: con...@192.168.154.163: 
> Permission denied (publickey,password).",
> "unreachable": true
>
> this is my inventory:
>
> 192.168.154.163 cyber01_ssh_pass="pass" cyber01_ssh_user=user
>
> Thank you
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/35390e98-0044-4ad8-8d91-a389e89604fdn%40googlegroups.com.