Re: [ansible-project] nfs client ansible

2020-03-27 Thread Mark Whaite
Hi

Are you missing a : from the src?

On Fri, 27 Mar 2020 at 09:08, Sandy Hung  wrote:

> dear all:
>
> fatal: [192.168.1.120]: FAILED! => {
> "changed": false,
> "invocation": {
> "module_args": {
> "dump": "0",
> "fstype": "nfs",
> "opts": "defaults,nobootwait",
> "passno": "2",
> "path": "/nfs",
> "sate": "mounted",
> "src": "192.168.1.146/share/share"
> }
> },
> "msg": "Unsupported parameters for (mount) module: sate Supported
> parameters include: backup, boot, dump, fstab, fstype, opts, passno, path,
> src, state"
> }
>
> i don't know why unsupported mount module
>
>
> my ansible
> ---
>  - hosts: all
>gather_facts: no
>become: yes
>
>tasks:
>  - name: Ensure NFS Common is installed
>apt: name=nfs-common update_cache=yes
>
>  - name: Create mountable dir
>file: path=/nfs state=directory mode=777 owner=sandy group=sandy
>
>  - name: set mountpoints
>mount:
>   path=/nfs
>   src=192.168.1.146/share/share
>   fstype=nfs
>   opts=defaults,nobootwait
>   dump=0
>   passno=2
>   sate=mounted
>
> --
> 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/ea6594b2-fe17-4f2f-9f91-07df91dfcbe6%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ea6594b2-fe17-4f2f-9f91-07df91dfcbe6%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Mark Whaite, Systems Administrator
Adelard LLP
Adelard LLP, Units 24 Waterside, 44-48 Wharf Road, London N1 7UX
Tel: 020 7832 5850
Web: http://www.adelard.com

This e-mail, and any attachments, is confidential and for the use of the
addressee only. If you are not the intended recipient, please telephone 020
7832 5850. We do not accept legal responsibility for this e-mail or any
viruses.

Registered office: Stourside Place, Station Road, Ashford, Kent TN12 1PP
Registered in England & Wales no. OC 304551. VAT no. 454 489808

-- 
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/CAHtMyqiR9v8HyZ0_by12yn6e-ja_mXayTQ-9u2OhKQbOu3UJ9g%40mail.gmail.com.


Re: [ansible-project] Very Very New to Ansible

2020-03-15 Thread Mark Whaite
Hi

What OS is the first machine in that play?
It doesn’t have python installed or more likely ansible cannot see it.

You can set the python path for the machine in the inventory. But it would
be would making sure it is installed on the off chance it is not.

There is more under client requirements here.

https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements


On Sun, 15 Mar 2020 at 09:30, Michael Cooper  wrote:

> Hello Everyone
>
>I built my control machine on a VM w/Ubuntu Server 18.04.4
> and ansible 2.5.1. Mind you I am just learning so the version shouldn't
> matter that much. I built my first and second target machines and I am
> testing the ansible ad-hoc commands.
>
> When I do an ansible  miscservers -m ping I get the following:
>
> $ ansible miscservers -m ping
> xxx.xxx.xx.x | FAILED! => {
> "changed": false,
> "module_stderr": "Shared connection to xxx.xxx.xx.x closed.\r\n",
> "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
> "msg": "MODULE FAILURE",
> "rc": 127
> }
> xxx.xxx.x.xx | SUCCESS => {
> "changed": false,
> "ping": "pong"
> }
>
> I do not know what to look for here to try and resolve this issue. Please
> may I get some ideas,
>
> Thanks,
> Michael
>
> --
> 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/a7395552-1400-4169-9cb8-587ab787a121%40googlegroups.com
> 
> .
>
-- 
Sent from my MP3 player

-- 
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/CAHtMyqj0JF21_oQsJ-qDvAkUno%2B1-_%3DXkbA9whd72NzMQ83EKA%40mail.gmail.com.


Re: [ansible-project] no hosts matched

2020-03-11 Thread Mark Whaite
Hi Sandy

I think it is the 'my hosts' line. I would place that  between []. or
remove it. I would  also move the vars to a group ver. So something like
this.

[my_hosts]
192.168.1.120

[my_hosts:vars]
ansible_connection=local
ansible_sudo_pass='xxx'
ansible_connection=local

On Wed, 11 Mar 2020 at 10:15, Sandy Hung  wrote:

> Dear all:
>
>  I have been normal before but this error message appeared in a few week
> can you help me.
> thanks.
>
>
> sandy@test-VirtualBox:~$ sudo ansible-playbook nfsclient.yml -i
> myinventory
> [WARNING]: Unable to parse /home/sandy/myinventory 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'
>
>
> PLAY [all]
> *
> skipping: no hosts matched
>
>
> my hosts
> 192.168.1.120 ansible_user=sandy
> 192.168.1.120 ansible_sudo_pass='xxx'
> 192.168.1.120 ansible_connection=local
>
> --
> 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/7912138a-9412-4cc5-9fb1-96d046112925%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/7912138a-9412-4cc5-9fb1-96d046112925%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Mark Whaite, Systems Administrator
Adelard LLP
Adelard LLP, Units 24 Waterside, 44-48 Wharf Road, London N1 7UX
Tel: 020 7832 5850
Web: http://www.adelard.com

This e-mail, and any attachments, is confidential and for the use of the
addressee only. If you are not the intended recipient, please telephone 020
7832 5850. We do not accept legal responsibility for this e-mail or any
viruses.

Registered office: Stourside Place, Station Road, Ashford, Kent TN12 1PP
Registered in England & Wales no. OC 304551. VAT no. 454 489808

-- 
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/CAHtMyqhmZyw%2BM4Son4nD98xXqoG0a%3De%2BHzmHT55kdDOcyQt8MQ%40mail.gmail.com.


Re: [ansible-project] Convert list to string in rendered Jinja template

2020-03-06 Thread Mark Whaite
Hi

You can find all about Jinja filters here
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html

But you can convert a list to a string using

{{ list | join(" ") }}

This will add a space between each element. I am not sure if that is what
you need.



On Fri, 6 Mar 2020 at 08:04, Shifa Shaikh  wrote:

> I have a variable files like below:
>
>   layers:
> - name: APP
>   things:
> - cactus
> - lotus
> - jasmine
> - rose
>   bgcolor:
> - sky blue
>
>
> - name: WAS
>   things:
> - mango
> - apple
>   bgcolor:
> - yellow
>
>
> Below is my jinja template file:
> {% for layer in layers %}
> 
> 
>  
> {% for item in layer.things %}
> {{ item }}
> {% endfor %}
> 
> 
> {% endfor %}
>
> I run this with the below playbook:
>
> ---
>   - name: Demonstrating variables in Jinja2 Loops
> hosts: localhost
> connection: local
> vars_files:
>   - vars.yml
> gather_facts: no
> tasks:
>   - name: Create the Jinja2 based templateone
>
> template: src=./varloop_new.j2 dest=./output.txt
>
>
>
> The output recieved has a problem.
>
> Output.txt:
>
> -bash-4.2$ cat output.txt
> 
> 
>  
> cactus
> lotus
> jasmine
> rose
> 
> 
> 
> 
>  
> mango
> apple
> 
> 
>
>
> It displays bgcolor="[u'sky blue']" instead of bgcolor="sky blue"
>
> How can I convert the list to a string in the jinja template.
>
> --
> 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/10765862-e99b-44bf-bdb8-0db36c1fc49b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/10765862-e99b-44bf-bdb8-0db36c1fc49b%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Mark Whaite, Systems Administrator
Adelard LLP
Adelard LLP, Units 24 Waterside, 44-48 Wharf Road, London N1 7UX
Tel: 020 7832 5850
Web: http://www.adelard.com

This e-mail, and any attachments, is confidential and for the use of the
addressee only. If you are not the intended recipient, please telephone 020
7832 5850. We do not accept legal responsibility for this e-mail or any
viruses.

Registered office: Stourside Place, Station Road, Ashford, Kent TN12 1PP
Registered in England & Wales no. OC 304551. VAT no. 454 489808

-- 
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/CAHtMyqgUtd%2BYD1%3DKuw5p89vUW_-EFdgRr%2BUPg%3D-pA7bF7N8xxw%40mail.gmail.com.