Re: [ansible-project] Need to automate task via bastion host

2023-04-03 Thread Avinash Jadhav
Hi

Can you please try to this way


[remote-nodes]
remote-node-1 ansible_host= ansible_user=user
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -p 8022 user@
"'
remote-node-2 ansible_host= ansible_user=user
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -p 8022 user@
"'


On Mon, Apr 3, 2023, 4:02 PM Monica  wrote:

> Hi Todd,
>
> Thank you for explaining the same, however I am still getting the same
> error-:
>
>
>
> On Mon, Apr 3, 2023 at 11:13 AM dulhaver via Ansible Project <
> ansible-project@googlegroups.com> wrote:
>
>> I agree with Tood, that setting up a propper ~/.ssh/config should be the
>> way to do this. something like ...
>>
>>Host jumphost
>>   HostName jumphost.blub.com
>>   User username
>>   PreferredAuthentication publickey
>>   IdentityFile ~/.ssh/demo.ed25519
>>
>>Host internal-target
>>   Hostname target.blub.com
>>   ProxyJump jumphost
>>   User username
>>   PreferredAuthentication publickey
>>   IdentityFile ~/.ssh/demo.ed25519
>>
>>
>> ... should do it I believe
>>
>>
>> > On 04/02/2023 10:51 PM CEST Todd Zullinger  wrote:
>> >
>> >
>> > Will McDonald wrote:
>> > > https://www.jeffgeerling.com/blog/2022/
>> > > using-ansible-playbook-ssh-bastion-jump-host
>> >
>> > Odd that uses ProxyCommand in `ansible_ssh_common_args` and
>> > not the far simpler ProxyJump, which it does mention in the
>> > ~/.ssh/config method.  The `-J` shortcut for that is even
>> > better.
>> >
>> > Perhaps it does that to illsutrate a more complex use case,
>> > where the bastion runs on a different port, but if you're
>> > not doing that, it's likely simpler to skip it and use the
>> > `-J` argument.
>> >
>> > I would expect (but have not tested) this works:
>> >
>> > ansible_ssh_common_args='-J $your_bastion_hostname'
>> >
>> > ProxyJump / -J was added in OpenSSH-7.3 -- so it's surely on
>> > any host folks would be using as an ansible control host.
>> >
>> > --
>> > Todd
>> >
>> > --
>> > 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/ZCnqsTK-z1LKdm05%40pobox.com
>> .
>>
>> ---
>> gunnar wagner | fichtestr. 1, 19386 lübz | fon: 0176 7808 9090
>>
>> --
>> 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/404677238.549090.1680500565843%40office.mailbox.org
>> .
>>
>
>
> --
>
> *Thanks and Regards,*
>
>
>
>
>
> *Monika Dharmshaktu*
>
>
>  EMail: monicaacision1...@gmail.com
>
> Cell: +91 9654525106
>
>
>
> --
> 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/CANi23%3Dy4qzVo6Ci9DReu%3DxvLHYx9Swokd_EaB8e1s_%3D_k5hDjQ%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/CABAvFDNCqVkZNqBVY7LvsV1crEzVVbDrDZNHVc04nOoXs5x%2BtA%40mail.gmail.com.


Re: [ansible-project] printing the items on dictionary format

2023-03-14 Thread Avinash Jadhav
>
> Hi

  you can try this way

>


> - name: printing the details of montreal
>   debug:
> msg: "{{ item.value.city }}"
>   loop: "{{ world | subelements('n_america') | dict2items }}"
>

-- 
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/CABAvFDMCkTBp4_%3DfNj2hv%2BdTWv2Tropgk%3DQsEtFEbw_fsoukqA%40mail.gmail.com.


Re: [ansible-project] read password from a variable

2023-03-09 Thread Avinash Jadhav
You can try this one
- name: Prompt for password
  vars_prompt:
- name: my_pwd
  prompt: "Enter your password"
  private: true

- name: Source the environment variable file
  shell: "source ./myenv"



- name: Retrieve password from Ansible Vault
  shell: "ansible-vault view my_password_file --vault-password-file
~/.vault_pass.txt"
  register: password_output

- name: Source the environment variable file
  shell: "source ./myenv"
  environment:
MY_PASSWORD: "{{ password_output.stdout }}"
[image: Avinash Jadhav]
Is there any other way/module to read the password from the variable ?

Yes, there are several ways to read a password from a variable in a secure
manner. One common method is to use the getpass module in Python.

The getpass module provides a way to securely prompt the user for a
password without echoing the characters typed to the screen. Here's an
example of how to use it:

pythonCopy code
import getpass

password = getpass.getpass(prompt='Enter your password: ')

When this code runs, the user will be prompted to enter their password, but
the characters they type will not be displayed on the screen. The password
will be stored in the password variable.

Another way to securely store passwords is to use an encryption library
like cryptography or pycryptodome. These libraries provide methods for
encrypting and decrypting sensitive information, including passwords.

However, it's important to keep in mind that no method is 100% foolproof,
and there is always some risk involved when handling sensitive information
like passwords. It's always a good idea to follow best practices for
password security, such as storing passwords in a secure password manager,
using strong and unique passwords, and using two-factor authentication
whenever possible.
[image: Avinash Jadhav]
Is there any other way/module to read the password from the variable using
the Ansible

Yes, there are several ways to securely read a password from a variable in
Ansible. Here are some options:

   1.

   Ansible Vault: Ansible Vault is a built-in feature that allows you to
   encrypt sensitive data, such as passwords and keys, in your inventory or
   playbook files. You can use the ansible-vault command to encrypt and
   decrypt files containing sensitive data. To read the password from an
   encrypted variable, you can use the ansible-vault command to decrypt the
   file containing the variable and then read the variable value.
   2.

   Ansible Credential Plugin: Ansible has a built-in credential plugin
   system that allows you to securely store and retrieve credentials, such as
   passwords and keys, from a variety of sources, including Hashicorp Vault,
   CyberArk, and more. To use a credential plugin to read a password from a
   variable, you can define the credential in your inventory or playbook and
   then use the lookup function to retrieve the password.
   3.

   Environment Variables: You can store sensitive data, such as passwords
   and keys, in environment variables and then read the variable value in your
   playbook using the lookup function. To ensure the security of the
   password, you should encrypt the environment variable using an external
   tool, such as ansible-vault or a third-party encryption tool.
   4.

   Python Script: You can write a custom Python script that reads the
   password from a file or another secure source, and then use the script
   module in Ansible to run the script and retrieve the password value.

Each of these options has its own pros and cons, so it's important to
choose the one that best suits your use case and security requirements.
[image: Avinash Jadhav]
my_pwd: hiddenpass - name: source the environment variable file shell: "
source ./myenv" while executing i am prompted with a password so I am using
the expect module to pass the password name: Case insensitive password
string match ansible.builtin.expect: command: source ./myenv responses:
(?i)password: "{{ my_pwd }}" # you don't want to show passwords in your
logs no_log: true it fails with below error: fatal: [127.0.0.1]: FAILED! =>
{ "censored": "the output has been hidden due to the fact that 'no_log:
true' was specified for this result", "changed": false } if i set no_log:
false , then i receive the below error "msg": "Failed to import the
required Python library (pexpect) Is there any other way/module to read the
password from the variable ?

Yes, there are other ways to read a password from a variable in Ansible
without using the expect module.

One way is to use the vars_prompt module to prompt the user for the
password at runtime. Here's an example:

yamlCopy code
- name: Prompt for password
  vars_prompt:
- name: my_pwd
  prompt: "Enter your password"
  private: true
- name: Source the environment variable file
  

Re: [ansible-project] what does this command Mean?

2020-10-02 Thread Avinash Jadhav
Hello  Prabhakaran,

What exactly you want try is it ping or any other task

Please add the host/ target IP or DNS in hosts files  the perform below
operation

If ping then try
1 create playbookdemo.yml
2 copy below code and paste playbookdemo.yml

   ---

 - name: "Get ping response"
   hosts: all
   tasks:
   - action: ping
 register: hello
   - debug: msg="{hello.stdout}"

3 Run using this ad-hoc command

ansible-playbook playbookdemo.yml


if you want to try to resolve error and warning please update you python
package above 2.7

or if you want to try encrypted you playbook then you should try to
ansible-playbook starfish.yml --ask-vault-pass


On Fri, 2 Oct 2020 at 13:58, Prabhakaran Karuppaih <
arrow.prabhaka...@gmail.com> wrote:

> ansible -m ping all
>
> Why am I getting the same warnings and Errors when I tried running my
> Playbook? (starfish.yml)
>
> So, that means: My Playbook is Right? But something important is Not. What
> is that?
> Please Help...Thank You.
>
> With Hope,
> Prabhakaran
>
> The following are the Warnings and Errors:
> /usr/lib/python2.7/site-packages/ansible/parsing/vault/__init_.py:44:
> CyptographyDeprecationWarning: Python 2 is no longer supported by the
> Python core team. Support for it is now deprecated in cryptography, and
> will be removed in a future release.
>  from cryptography.exceptions import InvalidSignature
> [WARNING]: * Failed to parse /etc/ansible/hosts with yaml plugin: We were
> unable to read either as JSON nor YAML, these are the errors we got from
> each: JSON: No JSON object could be decoded Syntax Error while loading
> YAML. expected '', but found '[' The error appears to be in
> '/etc/ansible/hosts': line 4, column 1, but may be elsewhere in the file
> depending on the exact syntax problem. The offending line appears to be: ]
> [starfish] ^ here
> [WARNING]: * Failed to parse /etc/ansible/hosts with ini plugin: need more
> than 2 values to upack
> [WARNING]:  Unable to parse /etc/ansible/hosts as an inventory source
> [WARNING]:  No inventory was parsed, only implicit localhost is available
> [WARNING]: provided hosts list is empty, only localhost is available. Note
> that the implicit localhost does not match 'all'
>
> --
> 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/5ec66558-240f-43dd-8391-86608e85d221n%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/CABAvFDNGyFbWOam%2BM6RcuQxPp0tZH0rOS81L3LsBUqz06BJxAQ%40mail.gmail.com.


Re: [ansible-project] Executing remote PowerShell script not generating required output

2020-09-08 Thread Avinash Jadhav
Hello Harsh,

Please try this one

- name: test
  hosts: test
  tasks:
  - name: warning
script: C:\\GeneratePassword.ps1






On Wed, 9 Sep 2020 at 11:40, harsh chawda  wrote:

> Hello All,
>
> I am trying to execute a PowerShell script present on remote system. It is
> executing successfully from ansible playbook side.
>
> After execution it should generate a *password.csv* file on the remote
> system, but that file is not getting generated.
>
> *My plabook:*
>
> - name: test
>   hosts: test
>   tasks:
>   - name: warning
> win_shell: powershell.exe -ExecutionPolicy ByPass -File
> C:\\GeneratePassword.ps1
>
>
> Please help me on this if anyone having any idea.
>
> Thanks in advance
>
> *Regards*
> *Harsh*
>
> --
> 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/6a1bfc60-b5c9-4d28-b97f-3ee1d8bf0ec2o%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/CABAvFDMACV5rGdrZOygh3OT2iyJZMztVxQcxDhYdS3TPj6PLGg%40mail.gmail.com.


Re: [ansible-project] Deploying a application using WAR file on Websphere

2020-09-02 Thread Avinash Jadhav
Hi Rachna,

Please find below playbook for  war file deployment you need to changes
your sources WAR and destination for Websphere

Thank you
Avinash


- hosts: tomcatServer
  vars:
  - warName: helloworld.war
  - warRemotePath: /path/to/put/war

  tasks:
  - name: Download WAR to server
synchronize: src={{ warLocalPath }}/{{ warName }} dest={{ warRemotePath
}}/{{ warName }}

  - name: Unzip WAR file
unarchive: src={{ warRemotePath }}/{{ warName }}
dest=/var/lib/tomcat7/webapps/ROOT/ copy=no mode=0755 owner=tomcat7
group=tomcat7
notify:
- Restart tomcat7

  - name: Delete remote war file
file: path={{ warRemotePath }}/{{ warName }} state=absent

  handlers:
- name: Restart tomcat7
  service: name=tomcat7 state=restarted

On Wed, 2 Sep 2020 at 16:31, Rachna Dodia  wrote:

> Need your inputs on how to go forward with deploying application using WAR
> file on Websphere using Ansible.
>
> I cannot see any modules or playbooks related to the same.
>
> Looking for any suggestion or approach how to take this forward.
>
> Thanks,
> Rachna Dodia
>
> --
> 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/c58bfb7b-fcde-4ab5-ab80-4049f9ee0a3dn%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/CABAvFDM%2B7J7z-T-cLdmE%2BV-A9eXtCX6kuVPtc1PctNahpgTahA%40mail.gmail.com.


Re: [ansible-project] Cisco Switch Discovery in Ansible Tower

2020-08-25 Thread Avinash Jadhav
Hi

firstly you need to create an inventory which you want to install and in
inventory need to mention DNS/IP/target name - any
second, write a playbook with a task which you need to install on the
target system




On Tue, 25 Aug 2020 at 17:46, shilpa Benakatti 
wrote:

> Hi..
> Thanks for the links. Should I run the script in inventory script?
>
> On Tue, 25 Aug, 2020, 3:26 PM Avinash Jadhav, 
> wrote:
>
>> Hello
>> Could you please follow this linked instruction
>> https://www.ansible.com/integrations/networks/cisco
>> https://developer.cisco.com/automation-ansible/
>>
>> On Tue, 25 Aug 2020 at 13:43, L&T  wrote:
>>
>>> Dear all,
>>>
>>> I am very new to Ansible Tower.
>>> I have few devices in my network like Cisco Router, Cisco Switch, VMware
>>> .
>>> I want add the Cisco Switch in this CM software, Can any one guide how
>>> to start this.
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ansible-project+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/0da4a177-c150-4c59-b5a2-179d9853e343n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/0da4a177-c150-4c59-b5a2-179d9853e343n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/CB-bpGZSO34/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/CABAvFDNdgRauM7Z26MZq6xezoxS5poVXnJ4jHo3mMfJNhP2Ckg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CABAvFDNdgRauM7Z26MZq6xezoxS5poVXnJ4jHo3mMfJNhP2Ckg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CAB1jSAXEcHcqNap56FiuTDPt3QgHCnwK8Wn9%2BWBtirtMekiFDQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAB1jSAXEcHcqNap56FiuTDPt3QgHCnwK8Wn9%2BWBtirtMekiFDQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABAvFDOXoDAm4T4KNJD4ifXSCkW-OUgdEidZ%2BdmP9p9vV0fBFw%40mail.gmail.com.


Re: [ansible-project] Cisco Switch Discovery in Ansible Tower

2020-08-25 Thread Avinash Jadhav
Hello
Could you please follow this linked instruction
https://www.ansible.com/integrations/networks/cisco
https://developer.cisco.com/automation-ansible/

On Tue, 25 Aug 2020 at 13:43, L&T  wrote:

> Dear all,
>
> I am very new to Ansible Tower.
> I have few devices in my network like Cisco Router, Cisco Switch, VMware .
> I want add the Cisco Switch in this CM software, Can any one guide how to
> start this.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/0da4a177-c150-4c59-b5a2-179d9853e343n%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/CABAvFDNdgRauM7Z26MZq6xezoxS5poVXnJ4jHo3mMfJNhP2Ckg%40mail.gmail.com.


Re: [ansible-project] Unable to receive Emall despite of success message from ansible script

2020-07-25 Thread Avinash Jadhav
Hi Samir

Please try this and make necessary changes

https://github.com/infinitypp/ansible-mail-module-examples/blob/master/tasks/main.yml


- hosts:
- localhost
  tasks:
- name: Sending an e-mail using Gmail SMTP servers
  mail:
host: smtp.gmail.com
port: 587
username: usern...@gmail.com
password: your-password
to: recipient-name 
subject: Ansible Report
body: System [[ ansible_hostname ]] has been successfully provisioned.
  delegate_to: localhost


On Sat, 25 Jul 2020 at 22:20, Samir Kothawade 
wrote:

> Yes it is. Actually I took the reference of an ansible documentation site
> for this writing above script. Here is the ref. screenshot  from ansible
> documentation.
>
> [image: image.png]
>
> On Sat, 25 Jul 2020 at 22:16, Jean-Yves LENHOF 
> wrote:
>
>> Look at your logs mail server(the one which answer on tcp port 25) if
>> there's something interesting in it...
>>
>> Regards,
>>
>>
>> Le 25/07/2020 à 18:43, Samir Kothawade a écrit :
>>
>> Ansible script:
>>
>> - hosts: local
>>   gather_facts: no
>>   tasks:
>>- name: mailing longevity report
>>  become: true
>>  mail:
>> host: localhost
>> port: 25
>> from: j...@example.net (Longevity Report)
>> to: Samir Kothawade 
>> 
>> subject:  testing mail Longevity Report
>> body: hi this is testing mail
>>
>>
>> Output observed after running above script:
>>
>>
>>
>>
>> I am not receiving emails after running above command despite if success
>> message from above script. Note -My network connectivity is good and
>> reachable to gmail as well.
>> Can someone help me out with this.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/08204b07-6128-416c-b89d-6dcddd41f0d2o%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/b9f7d451-9c39-5f2f-01d0-a76aeb6e2b96%40lenhof.eu.org
>> 
>> .
>>
> --
> 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/CAA%3Dr5yedn4WgwpGUiBcY__avQwGW_G2q5WrAUN2VU2Sc4Tj24Q%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/CABAvFDMap9rBAocxHVFAURLyfwxBaduQnFeC__yEuc3Bjve%3DHg%40mail.gmail.com.


[ansible-project] Centralized Unix Server File system Management

2020-07-14 Thread Avinash Jadhav
Hello Ansible User/Team,

I am trying to developed  Centralized Unix Server File system Management  
using ansible playbook

I need help from all of your team,

Below is requirement using ansible 

Problem Statement - Unavailability of Centralized Unix Server File system 
Management becomes resource-intensive and error-prone task.
Objective - Develop a mechanism to  manage Unix  File system 
administration   across the Environment
Expected Outcome - Mechanism may  have the following functionality :
1] Scan new disks
2] Create /modify/Delete Partition
3] Create /modify/Delete physical volumes.
4] Create /modify/Delete  volume groups.
5] Create /modify/Delete  logical volumes.
6] Create /modify/Delete a file system.
7]Mount/unmount a file system
8]  Reports
   - Total Storage Used
   - Total Storage Available


Request you to all please provide your suggestion or any sample playbook of 
linke it can be help for me that.

I appreciated in advance  

Thank you 
AJ

-- 
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/fd8ca47a-e2b1-425d-8cfa-cf7aa225a4a8o%40googlegroups.com.


Re: [ansible-project] fatal: [localhost]: FAILED! => {"changed": false, "msg": "Instance creation failed

2020-06-23 Thread Avinash Jadhav
https://www.mindbowser.com/how-to-create-ec2-instances-using-ansible/

please jump on the above link

On Tue, 23 Jun 2020 at 15:46, Abhijeet Kasurde  wrote:

> Hi Avinash,
>
> Mujeeb already tried these things. Error is due to ARM AMI not running on
> any region. I don't have an account to test this. Can you please help?
>
> Mujeeb, please specify all details like AMI and region details and console
> log.
>
> On Tue, Jun 23, 2020 at 3:41 PM Avinash Jadhav 
> wrote:
>
>> Hi Mujeeb,
>> Please follow the below step
>>
>> Once you are done with the AWS account and the User creation, you can
>> move forward and install the required things.
>>
>>1. Ansible:
>>   1. Install Ansible on a RHEL/CentOS Linux based system
>>  1. *$ sudo yum install Ansible*
>>   2. Install Ansible on a Debian/Ubuntu Linux based system
>>  1. *$ sudo apt-get install software-properties-common*
>>  2. *$ sudo apt-add-repository ppa:Ansible/Ansible*
>>  3. *$ sudo apt-get update*
>>  4. *$ sudo apt-get install Ansible*
>>   3. Install Ansible using pip
>>  1. *$ sudo pip install Ansible*
>>  2. *Once installed you can verify by Ansible –version this
>>  command.*
>>   2. Python:
>>   1. $ sudo apt-get update
>>   2. $ sudo apt-get install python3.6
>>   3. You can follow this link
>>   <https://docs.python-guide.org/starting/install3/linux/> for more
>>   details.
>>3. Boto: (Boto is a Python package which provides an interface to
>>AWS.)
>>   1. First, install pip
>>  1. *$ sudo apt install python3-pip or*
>>  2. *$ yum install python-pip*
>>   2. Now install boto
>>  1. *$ pip install boto*
>>
>> Now, we are done with the package installation, we can move ahead and
>> start writing our Ansible playbook.
>> Note: There are multiple ways you can install the above packages. I have
>> added the ones that I followed but you can install as per your knowledge.
>> Now open a terminal and create a file with the extension .yml or .ymal,
>> add below script and save it.
>>
>> # Basic provisioning example
>> - name: Ansible test
>> hosts: localhost
>> tasks:
>> - name: launching AWS instance using Ansible
>> ec2:
>> key_name: aws_instance_Ansible
>> instance_type: t2.micro
>> image: ami-0dacb0c129b49f529
>> region: us-east-2
>> wait: yes
>> group: Ansible
>> count: 1
>> vpc_subnet_id: default
>> assign_public_ip: yes
>> aws_access_key: ***
>> Aws_secret_key: ***
>>
>>
>> On Tue, 23 Jun 2020 at 15:37, Mujeeb k.s  wrote:
>>
>>> Hi
>>>
>>> I am trying to create EC2 in using play book, but i am unable to create
>>> instance
>>> I am getting below error
>>>
>>> Please help me, how can i fix this issue
>>>
>>>
>>> [root@jenkinansible ansible]# ansible-playbook ec2.yml
>>>
>>> PLAY [creating ec2 instance]
>>> 
>>>
>>> TASK [Gathering Facts]
>>> **
>>> ok: [localhost]
>>>
>>> TASK [creating ec2 instance]
>>> 
>>> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Instance
>>> creation failed => Unsupported: The requested configuration is currently
>>> not supported. Please check the documentation for supported
>>> configurations."}
>>>
>>> PLAY RECAP
>>> **
>>> localhost  : ok=1changed=0unreachable=0
>>> failed=1skipped=0rescued=0ignored=0
>>>
>>> [root@jenkinansible ansible]#
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>>

Re: [ansible-project] fatal: [localhost]: FAILED! => {"changed": false, "msg": "Instance creation failed

2020-06-23 Thread Avinash Jadhav
Hi Mujeeb,
Please follow the below step

Once you are done with the AWS account and the User creation, you can move
forward and install the required things.

   1. Ansible:
  1. Install Ansible on a RHEL/CentOS Linux based system
 1. *$ sudo yum install Ansible*
  2. Install Ansible on a Debian/Ubuntu Linux based system
 1. *$ sudo apt-get install software-properties-common*
 2. *$ sudo apt-add-repository ppa:Ansible/Ansible*
 3. *$ sudo apt-get update*
 4. *$ sudo apt-get install Ansible*
  3. Install Ansible using pip
 1. *$ sudo pip install Ansible*
 2. *Once installed you can verify by Ansible –version this
 command.*
  2. Python:
  1. $ sudo apt-get update
  2. $ sudo apt-get install python3.6
  3. You can follow this link
   for more
  details.
   3. Boto: (Boto is a Python package which provides an interface to AWS.)
  1. First, install pip
 1. *$ sudo apt install python3-pip or*
 2. *$ yum install python-pip*
  2. Now install boto
 1. *$ pip install boto*

Now, we are done with the package installation, we can move ahead and start
writing our Ansible playbook.
Note: There are multiple ways you can install the above packages. I have
added the ones that I followed but you can install as per your knowledge.
Now open a terminal and create a file with the extension .yml or .ymal, add
below script and save it.

# Basic provisioning example
- name: Ansible test
hosts: localhost
tasks:
- name: launching AWS instance using Ansible
ec2:
key_name: aws_instance_Ansible
instance_type: t2.micro
image: ami-0dacb0c129b49f529
region: us-east-2
wait: yes
group: Ansible
count: 1
vpc_subnet_id: default
assign_public_ip: yes
aws_access_key: ***
Aws_secret_key: ***


On Tue, 23 Jun 2020 at 15:37, Mujeeb k.s  wrote:

> Hi
>
> I am trying to create EC2 in using play book, but i am unable to create
> instance
> I am getting below error
>
> Please help me, how can i fix this issue
>
>
> [root@jenkinansible ansible]# ansible-playbook ec2.yml
>
> PLAY [creating ec2 instance]
> 
>
> TASK [Gathering Facts]
> **
> ok: [localhost]
>
> TASK [creating ec2 instance]
> 
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Instance
> creation failed => Unsupported: The requested configuration is currently
> not supported. Please check the documentation for supported
> configurations."}
>
> PLAY RECAP
> **
> localhost  : ok=1changed=0unreachable=0
> failed=1skipped=0rescued=0ignored=0
>
> [root@jenkinansible 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/509b3dbe-e01c-4a52-833d-65eb0c5dedb8o%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/CABAvFDOpaNCLqh%3Dc-mszTXuifQ%2B3R%2BYSZtwF9PQn%3DMh0Xf0aAg%40mail.gmail.com.


Re: [ansible-project] windows CPU Memory Swap-Memory utilization report in txt format

2020-06-16 Thread Avinash Jadhav
Hi Thank you for great information on that

ill try using win_shell and win_command

On Tue, 16 Jun 2020 at 15:40, Игорь Туровский  wrote:

> Well, while you can use Ansible to run smth like Get-Process with
> Ansible's win_shell or tasklist with win_command  and then parse and
> analyze responses, this is not smth Ansible should be used for (IMHO) as
> this is task for monitoring system like Zabbix/SCOM.  Keep in mind
> that Ansible requires some CPU/Memory to run its tasks on the managed node,
> so if you windows machine is under heavy load, you will have to wait for
> Ansible's taks completion for a long time.
> You may want to take a look into Telegraf ->
> InfluxDB/Graphite/Prometheus->Grafana stack.
> In this case your metrics (CPU/Memory) are shipped by a Telegraf agent
> running on Windows to TSDB of your choice and exposed as graphs, tables,
> etc in Grafana.
> All these components can be installed and configured with Ansible.
>
>
> вт, 16 июн. 2020 г. в 12:30, Avinash Jadhav :
>
>> Hello Ansible Team
>>
>> I am trying to develped below task
>>
>> CPU/Memory related alerts need manual intervention to review the system
>> health against the resources consuming the CPU/MEMORY. Every time engineer
>> needs to login to the system and performs the troubleshooting leading more
>> effort consumption *Objective - To develop the mechanism that enables
>> centralized management of CPU/Memory utilization issues* *Expected
>> Outcome - Mechanism may provide functionality :* • Find Total MEM/CPU
>> Utilization • List Top 20 CPU/MEM Utilization in process • List Virtual
>> memory Statistics • List of Virtual CPU Statistics
>>
>> Team any one have idea please help me on that how i do this using ansible
>> for widows
>>
>> Thank you Team
>> Avinash
>>
>> --
>> 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/73c544ea-0347-4a26-affa-a803e5f40449o%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/73c544ea-0347-4a26-affa-a803e5f40449o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CAM1nFkH_8D3rcNS3v8PbvNCCZqSncTUvjkZXqkXeBX-UD21OVA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAM1nFkH_8D3rcNS3v8PbvNCCZqSncTUvjkZXqkXeBX-UD21OVA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABAvFDMoLJqz3wtS_9q5fWBjT7eyYLrJFhVz%2B2vFP5YxeEG0tQ%40mail.gmail.com.


[ansible-project] windows CPU Memory Swap-Memory utilization report in txt format

2020-06-16 Thread Avinash Jadhav
Hello Ansible Team

I am trying to develped below task 

CPU/Memory related alerts need manual intervention to review the system 
health against the resources consuming the CPU/MEMORY. Every time engineer 
needs to login to the system and performs the troubleshooting leading more 
effort consumption *Objective - To develop the mechanism that enables 
centralized management of CPU/Memory utilization issues* *Expected Outcome 
- Mechanism may provide functionality :* • Find Total MEM/CPU Utilization • 
List Top 20 CPU/MEM Utilization in process • List Virtual memory Statistics 
• List of Virtual CPU Statistics 

Team any one have idea please help me on that how i do this using ansible 
for widows 

Thank you Team
Avinash

-- 
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/73c544ea-0347-4a26-affa-a803e5f40449o%40googlegroups.com.


[ansible-project] check ping SSH connection for multiple host and uptime using playbook

2020-06-13 Thread Avinash Jadhav
Hello All,

I am trying to develop playbook check the ping, ssh, and uptime for 
multiple server /host 

Ping if is successfully  then print Yes otherwise No

SSH if successfully then checks for uptime  and print Y and Uptime 
otherwise No

I am looking below output 

   Centralized Server Availability Check.
---
Date:-06/09/2020 
OS:-Linux
User:-ansible or root 
--
Started Device Down Bulk Check at:  Tue Jun 9 10:38:00 CDT 2020
 
---
   Server_Name|Ping|Ssh|
   Uptime_Status| Remarks   |
 
-||---||---|
kdcbam-u-rhvc.clt01.ulx.703.as19229.net  |  Y | Y |  7 days, 1 hours, 13 
minutes. |  Greater than 24 hrs. |
 
mdcbam-u-rhvc.dus01.ulx.703.as19229.net  |  Y | Y |  7 days, 1 hours, 17 
minutes. |  Greater than 24 hrs. |
 
nessus-proxy.clt01.ulx.703.as19229.net  |  Y | Y |  1088 days, 18 hours, 46 
minutes. |  Greater than 24 hrs. |
 
nimodcprime01.oma01.ulx.703.as19229.net  |  Y | Y |  6 days, 14 hours, 10 
minutes. |  Greater than 24 hrs. |

-- 
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/54a58aba-ef76-4fa3-96f9-8b2c38b63433o%40googlegroups.com.