Below playbook gets the disk usage percentage of '/tmp' from a list of
remote_hosts [20 remote servers] and stores it locally (delegate_to) in a
file {{ playbook_dir }}/tmpfiles/stats.yml
---
hosts: remote_hosts
tasks:
- name: Generate JSON data
lineinfile:
path: "{{
I am coming up short on this, but wondering if anyone has tried, or has
recommendations for querying error logs stored in Splunk with Ansible? The
reason is to push the query load to the Splunk servers and not the
production servers.
Thanks in advance.
--
You received this message because
On Wed, Mar 25, 2020 at 09:27:40PM +0200, patrick patra wrote:
> hello everyone can someone help me with documentatiions on ansible network
> automation
> (routers,switches,..)
> for example if i want to make a LAN then i want to deploy configurations
> automatically with ansible playbooks
>
>
hello everyone can someone help me with documentatiions on ansible network
automation
(routers,switches,..)
for example if i want to make a LAN then i want to deploy configurations
automatically with ansible playbooks
thanks to help me am just a biginner
Le mer. 25 mars 2020 à 21:10, Kai Stian
On Wed, Mar 25, 2020 at 09:54:07AM -0700, Shifa Shaikh wrote:
> @Kia Hi,
>
> As suggested I tried
>
> item.size_total instead of item.size_available
>
> "{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total -
> item.size_available) / item.size_total)) | round(1, 'common') }}"
>
I'd suggest putting a debug showing you the three numbers Ansible is using
for item.size_total and item.size_available. As @klingac mentioned, it
could be that the values that ""df -k" reports or uses in it's computation
aren't the exact same ones that Ansible uses.
For instance, using the
It could be this kind of problem
http://linuxshellaccount.blogspot.com/2008/12/why-du-and-df-display-different-values.html
`df` reads only and trusts completely to superblocks.
Another reason could be, that you can have other running process that can
keep a deleted file open.
Do you have
@Kia Hi,
As suggested I tried
item.size_total instead of item.size_available
"{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total -
item.size_available) / item.size_total)) | round(1, 'common') }}"
but it still gives me 22.2 % value instead of 19%
Can you please let me
On Wed, Mar 25, 2020 at 07:15:51AM -0700, Shifa Shaikh wrote:
>
> "{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total -
> item.size_available) / item.size_available)) | round(1, 'common') }}"
That is not how you calculate percentage, you need to divide on item.size_total
and
$ ansible --version
ansible 2.9.6
config file = ~/repos/ansible/ansible.cfg
configured module search path = ['~/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
ansible python module location =
~/.local/lib/python3.7/site-packages/ansible
executable location =
Here is the output of df -k from the target server:
# df -k
> Filesystem 1K-blocks Used Available Use% Mounted on
> devtmpfs 1905280 0 1905280 0% /dev
> tmpfs 1922024 0 1922024 0% /dev/shm
> /dev/sda1 1942528 295616 1646912 16% /boot
> /dev/mapper/OMT-home 15718400 832120 14886280 6% /home
>
Here is the output of df -k from the target server:
ok: [myhostone] => (item={u'block_used': 2857014, u'uuid':
> u'3fa1ec29-aca5-476b-8041-6a7bc6b1efc2', u'size_total': 52701921280,
> u'block_total': 12866680, u'mount': u'/ihs', u'block_available': 10009666,
> u'size_available':
�
I check this pip3 and python is installed, but still same error
I don’t know how to solved it.
�
�
�
BR
Sandy
�
From: ansible-project@googlegroups.com On
Behalf Of Dick Visser
Sent: Wednesday, March 25, 2020 4:02 PM
To: ansible-project@googlegroups.com
Subject: Re:
On 3/25/20 9:18 AM, sandy.h...@abagile.com wrote:
> In user ldap should be use “root”
>
> Use command line
>
> sudo apt-get install pip3
>
> sudo pip3 install boto3
>
It is possible that Ansible uses Python 2 on the target.
To enforce Python 3 on the target, you can set the following
In user ldap should be use “root”
Use command line
sudo apt-get install pip3
sudo pip3 install boto3
�
�
BR
Sandy
�
From: ansible-project@googlegroups.com On
Behalf Of Dick Visser
Sent: Wednesday, March 25, 2020 4:02 PM
To: ansible-project@googlegroups.com
Subject: Re:
How exactly did you install boto3?
As what user etc
On Wed, 25 Mar 2020 at 08:52, Sandy Hung wrote:
> ansible 2.9.4
> config file = /etc/ansible/ansible.cfg
> configured module search path = [u'/home/ldap/.ansible/plugins/modules',
> u'/usr/share/ansible/plugins/modules']
> ansible
ansible 2.9.4
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/ldap/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python
It means that your boto3 is not available to ansible.
Wrong location? Different venv?
What does 'ansible --version' say?
On Wed, 25 Mar 2020 at 08:07, Sandy Hung wrote:
> Dear All:
>
> I have create efs ansible , I have install boto3
> this is show error msg
>
> this is my ansible
> ---
> -
Dear All:
I have create efs ansible , I have install boto3
this is show error msg
this is my ansible
---
- hosts: localhost
connection: local
gather_facts: no
vars_files:
- ec2key.yml
tasks:
- name: Create EFS
efs:
state: present
19 matches
Mail list logo