[ansible-project] High CPU utilization by Ansible

2023-07-05 Thread Mohan Viswanathan
Hi Team, This mail is regarding the CPU utilization of the Ansible I have a Centos (version 8) Machine where Ansible is installed ( 4CPU and 16GB RAM) Executing 2 to 3 parallel calls takes up to 100% CPU Help us to know if any optimization can be done here Setup details *Machine where Ansible

[ansible-project] CPU utilization

2023-07-05 Thread Mohan Viswanathan
var: host_output.stdout_lines Thanks mohan -- 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.co

Re: [ansible-project] Ansible module for VM workstation to PowerOn & PowerOff

2022-07-25 Thread Mohan
d also, more crudely, just stop/start using vmrun.exe > [stop|suspend|start] and wrap that with > command/shell/win_powershell. > > > On Mon, 25 Jul 2022 at 12:59, Mohan wrote: > >> Hello Community members, >> >> I’m using vmware workstation version 15.0.

[ansible-project] Ansible module for VM workstation to PowerOn & PowerOff

2022-07-25 Thread Mohan
Hello Community members, I’m using vmware workstation version 15.0.0 on Ubuntu-20.04-LTS machine. We have deployed VM workstation based Windows-10 machines in that. I want to know which ansible module we can use to *PowerOn *and *PowerOff *windows-10 virtual machines from workstation? I was se

[ansible-project] Restricting Commands after privilege escalation using sudo in ansible.

2020-05-29 Thread varun mohan
Hi, Currently ansible uses wrapper scripts(shell/python) for executing commands as privileged user suing sudo. Due to this its currently not possible to restrict what commands ansible fires on the remote machine after privilege escalation. Main reason being ansible required NO PASSWD:ALL or NO

[ansible-project] Re: Building inventory from csv file

2018-11-14 Thread Mohan L
> > > > tasks: > - name: efine Values From CSV File > set_fact: > tenant: "{{ lookup('csvfile', ' > file=/root/ansible/tasks/csv-file/example.csv delimiter=, col=1') }} > > Your error seems due to missing closing double quote in the above line. tenant: "{{ lookup('csvfile', ' fil

Re: [ansible-project] Re: unarchive a file is failing

2018-11-13 Thread Mohan L
I am not clear about what you are trying to achieve here. are you using XYZ in with_items? Please note you have to quote src and dest in XYZ otherwise Ansible will treat src/dest are variables. On Tuesday, November 13, 2018 at 2:28:55 PM UTC+5:30, Mohan L wrote: > > > I am not cl

Re: [ansible-project] Re: unarchive a file is failing

2018-11-13 Thread Mohan L
- > - hosts: all > vars_files: > - /etc/ansible/xxx/xyz/vars/main.yml > tasks: > - name: test > unarchive: > src: "{{ item.src_tar }}" > dest: "{{ item.dest_tar }}" > with_items: "{{ TAR }}" > > > On Tu

Re: [ansible-project] Re: unarchive a file is failing

2018-11-13 Thread Mohan L
in.yml': line 26, column 5, > but may\nbe elsewhere in the file depending on the exact syntax > problem.\n\nThe offending line appears to be:\n\n\n - name: test\n^ > here\n"} > > > On Tuesday, November 13, 2018 at 12:46:58 PM UTC+5:30, Keshipeddy Anusha > w

Re: [ansible-project] Re: unarchive a file is failing

2018-11-13 Thread Mohan L
Ansible think src_tar as variable If you don't place quotes so through error saying undefined variable. On Tuesday, November 13, 2018 at 12:46:58 PM UTC+5:30, Keshipeddy Anusha wrote: > > Thank you Mohan that worked for me, but may I know why we need to place > them in

[ansible-project] Re: unarchive a file is failing

2018-11-12 Thread Mohan L
You have to quote the dictionary key as well. FROM - { src_tar: '/home/virtual/xx/sample.tar.gz', dest_tar: '/tmp/sss/' } TO - { 'src_tar': '/home/virtual/xx/sample.tar.gz', 'dest_tar': '/tmp/sss/' } Here is the working example. If you write a role and call that role from playbook then y

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Mohan L
lly from client to itself > > frank > > > > On 11/02/2018 10:25 AM, Mohan L wrote: > > Try with command or shell module with cp -f. > > > > On Friday, November 2, 2018 at 2:21:33 PM UTC+5:30, Keshipeddy Anusha > wrote: > > > > No change

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Mohan L
Try with command or shell module with cp -f. On Friday, November 2, 2018 at 2:21:33 PM UTC+5:30, Keshipeddy Anusha wrote: > > No change Mohan > It is not replacing the file > > On Fri, Nov 2, 2018, 2:20 PM Mohan L > wrote: > >> copy module with force yes automaticall

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Mohan L
te server? > > Thank you for your help. > > Thanks, > Anusha > > On Thu, Nov 1, 2018, 8:07 PM Mohan L > wrote: > >> >> What is happening when you try to use force: yes? >> >> *force* >> bool >> >>*Choices:* >>-

[ansible-project] Re: File with variables (template)

2018-11-02 Thread Mohan L
Did you get any chance to read this template module doc? https://docs.ansible.com/ansible/latest/modules/template_module.html Just read a very basic usage of template module: http://www.mydailytutorials.com/ansible-template-module-examples/ If I have a file and the user wants to pass variable

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-01 Thread Mohan L
rote: > >> Thank you Mohan that worked for me >> >> -- >> 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 >>

Re: [ansible-project] Re: WinRM - running ansible on widnows returning error

2018-11-01 Thread Mohan L
-powershell On Thursday, November 1, 2018 at 4:15:12 PM UTC+5:30, nadim mansour wrote: > > is thier another way like doing manual steps or rules. > The client will not allow us to run the script on his amchines > could you please help or advice ? > > On Thu, Nov 1, 2018 a

[ansible-project] Re: WinRM - running ansible on widnows returning error

2018-11-01 Thread Mohan L
Run this PowerShell script on your windows machine: https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 That will configure the necessary changes to allow Ansible to connect to windows. On Thursday, November 1, 2018 at 3:50:19 PM UTC+5:30, nadim mans

[ansible-project] Re: Use a loop with_items into a body command of uri ansible module

2018-10-31 Thread Mohan L
It works to me. --- - hosts: all tasks: - name: Generate responce with given status code uri: url: "https://httpbin.org/post"; method: POST body_format: json body: "{ \"codes\": {{ item }} }" return_content: yes with_items:

[ansible-project] Re: Passing variables to a template / jinja2 ??

2018-10-31 Thread Mohan L
1). Send all your user input to ansible playbook command using —extra-vars. You can also pass as json and yaml file. Example: # ansible-playbook site.yml —extra-vars “http_server_root=/var/www/html http_listen=8080 http_user=apache http_group=apache” https://docs.ansible.com/ansible/2

[ansible-project] Re: How to add a particular module to Ansible than merely doing an Ansible upgrade totally

2018-10-31 Thread Mohan L
/ansible/2.5/user_guide/playbooks_best_practices.html#content-organization https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#bundling-ansible-modules-with-playbooks Thanks Mohan L On Wednesday, October 31, 2018 at 12:16:21 PM UTC+5:30, rang...@gmail.com wrote: > &

Re: [ansible-project] Re: ansible vault with ad hoc command line

2018-10-31 Thread Mohan L
unctionality without creating > vault file with same group name which we given in inventory file into > /etc/ansible/group_var/? > > > Thanks & Regards > > Rajendra Rawat > > > On Tue, 30 Oct 2018 at 17:06, Mohan L > > wrote: > >> >> >&

[ansible-project] Re: Determine which network a host is on

2018-10-30 Thread Mohan L
Did you get any chance to through setup module? https://docs.ansible.com/ansible/latest/modules/setup_module.html Synopsis - This module

Re: [ansible-project] Re: ansible vault with ad hoc command line

2018-10-30 Thread Mohan L
is no where is it > using the vault for ad hoc command. It is using it for playbook. > > Request you to please share a example of ping module as I did in > my previous email that would be helpful understanding it. > > ad-hoc command: > > ansible -m ping > > Please

Re: [ansible-project] Re: ansible vault with ad hoc command line

2018-10-29 Thread Mohan L
vault files or vars that are encrypted with different passwords can be used at the same time. That what Andrew was mentioned on his post. On Tuesday, October 30, 2018 at 1:04:03 AM UTC+5:30, Rajendra Rawat wrote: > > Hi Mohan, > > I tried running ad-hoc command as you suggest

[ansible-project] Re: Copy multiple files to different locations on remote server

2018-10-29 Thread Mohan L
do you want to copy multiple target like this? # cat site.yml --- - hosts: all vars: file_list: - { src: '/tmp/myfiles/file1.txt', dst: '/tmp/target1/file1.txt' } - { src: '/tmp/myfiles/file2.txt', dst: '/tmp/target2/file2.txt' } - { src: '/tmp/myfiles/file3.txt',

[ansible-project] Re: Copy multiple files to different locations on remote server

2018-10-29 Thread Mohan L
[localhost] => (item=file4.txt) PLAY RECAP ** localhost : ok=2changed=0 unreachable=0failed=0 Thanks Moh

[ansible-project] Re: ansible vault with ad hoc command line

2018-10-29 Thread Mohan L
vault_key localhost | SUCCESS => { "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/tmp/hello", "secontext": &

[ansible-project] YAML code to list yum repositories and yum history using yum module.?

2018-02-08 Thread Mohan Ganesan
I would like to explore yum module in my yaml code. I am looking for a YAML code to list yum repositories and yum history using yum module. Are the commands yum repolist & yum history built on the yum module? Please let me know. Thanks. -- You received this message because you are subscribed to

[ansible-project] Learning Ansible

2017-09-15 Thread Mohan Musti
Hi , I am sure this question is already asked . but i couldn`t find the post . I wanted to learn from others how they approached to learn and master Ansible. any insight is helpful . As of now i started with resources on ansible site . Regards , Mohan -- You received this message because

[ansible-project] Service Module ERROR : No JSON Could be decoded

2016-09-27 Thread mohan . kaimal
ansible --version ansible 2.1.1.0 config file = /etc/ansible/ansible.cfg configured module search path = Default w/o overrides While running the below playbook , i'm getting JSON object error at the service stop level . --- - hosts: all become: yes gather_facts: yes tasks: - n

[ansible-project] Service module error : NO JSON object could be decoded

2016-09-27 Thread mohan . kaimal
ansible --version ansible 2.1.1.0 config file = /etc/ansible/ansible.cfg configured module search path = Default w/o overrides While running the below playbook , i'm getting JSON object error at the service stop level . --- - hosts: all become: yes gather_facts: yes tasks: - n

[ansible-project] local_action calling python script in ansible 2.1

2016-07-22 Thread Mohan L
to 2.1 and it is not working. Can some one through light on the issue? Thanks Mohan L -- 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 ansib

[ansible-project] Re: Register command output with_items

2016-05-09 Thread Srividhya Mohan
Hi John Do you mind sharing your playbook with me? So that I can take a look at the code. Thanks Sri On Sunday, May 1, 2016 at 4:57:22 AM UTC-4, John Buxton wrote: > > Sri, > It would help if the your output matched the playbook you are running. > Your problem task isn't even in your test playb

[ansible-project] Register command output with_items

2016-04-28 Thread Srividhya Mohan
Hi I have the following in my playbook - hosts: localhost tasks: - name: echo output command: echo {{item}} register: echo_output with_items: - hi - hello - debug: msg="{{ echo_output.results}}" When I run this playbook, I am getting the

[ansible-project] Roles with tags not respecting the tag, Instead playing all the tast defined

2015-04-07 Thread Vijay Mohan
Here is my play book: - name: Install MySQL with replication hosts: mysql-master:mysql-slave user: root sudo: false roles: - common - admin-users - generic-directories - { role: iptables, tags: [ 'mysql-iptables'] } - mysql I have ip tables tasks for different ports

Re: [ansible-project] What is the proper way to check for required variables?

2015-03-28 Thread Vijay Mohan
Hi Guys, I am trying to force the ansible play to check againt the command line variable, here is my "check-requirement.yml" and required_var: - fail: msg="Bailing out this play requires '{{ item }}'" when: item is not defined with_items: required_vars I have set default/main.yml with follo

Re: [ansible-project] Bug - RDS ansible module cannot change security_group if rds instance within VPC

2013-12-30 Thread Mohan Krishnan
mmand="modify" Thanks! Mohan On Thursday, 26 December 2013 10:47:49 UTC+8, Mohan Krishnan wrote: > > Although that would work, it might lead to folks setting the subnet > argument and expecting to actually have an effect, but if we are just > dropping it off - you would h

Re: [ansible-project] Bug - RDS ansible module cannot change security_group if rds instance within VPC

2013-12-26 Thread Mohan Krishnan
wrote: > > Seems like the solution is to not send the "subnet" parameter when it's > going to be invalid? > > > > > On Sun, Dec 22, 2013 at 7:53 AM, Mohan Krishnan > > wrote: > >> Hello, >> >> The code relies on the "subnet" argum

[ansible-project] Bug - RDS ansible module cannot change security_group if rds instance within VPC

2013-12-23 Thread Mohan Krishnan
is pull request implements the separation - https://github.com/ansible/ansible/pull/5389 The downside is it does introduce a backward incompatible change to the arguments if you use a VPC based rds. Instead of using security_groups you will now need to use vpc_security_groups. What do you guys th