Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 465

ofi03@146.59.156.

114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

Last login: Mon Oct    3 08:26:57 2022 from 176.160.191.208


ofi03@svl200:~$

Network error: Software caused connection abort


~
────────────────────────────────────────────────────────────────────────────────
~
Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"handler.yaml" [New File]                                                           
0,0-1                  All
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)


* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Mon Oct    3 13:13:55 2022 from 176.160.191.208
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ vim handler.yaml
ansadmin@svl200:~$ sudo vim handler.yaml
ansadmin@svl200:~$ sudo vim index.html
ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [146.59.158.16]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]

TASK [copy index.html]


***************************************************************
changed: [146.59.158.16]

RUNNING HANDLER [restart_nginx]


******************************************************
changed: [146.59.158.16]

PLAY RECAP
***************************************************************************
146.59.158.16                            : ok=4      changed=2      unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ 146.59.158.16 ^C
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$ sudo vim handler.yaml
ansadmin@svl200:~$ ansible-playbook handler.yaml
[WARNING]: Could not match supplied host pattern, ignoring: cible{1
[WARNING]: Could not match supplied host pattern, ignoring: 2}

PLAY [configure webserver with nginx]


************************************************
skipping: no hosts matched

PLAY RECAP
***************************************************************************

ansadmin@svl200:~$ sudo vim handler.yaml


ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [copy index.html]


***************************************************************
ok: [146.59.158.16]
changed: [141.95.160.133]

RUNNING HANDLER [restart_nginx]


******************************************************
changed: [141.95.160.133]

PLAY RECAP
***************************************************************************
141.95.160.133                          : ok=4      changed=2      unreachable=0   
failed=0        skipped                    =0        rescued=0        ignored=0
146.59.158.16                            : ok=3      changed=0        unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim handler.yaml


ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [install    nginx]
****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [copy index.html]


***************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
***************************************************************************
141.95.160.133                          : ok=3      changed=0        unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0
146.59.158.16                            : ok=3      changed=0        unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim handler.yaml


ansadmin@svl200:~$ sudo vim index.html
ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [copy index.html]


***************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

RUNNING HANDLER [restart_nginx]


******************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
***************************************************************************
141.95.160.133                          : ok=4      changed=2      unreachable=0   
failed=0        skipped                    =0        rescued=0        ignored=0
146.59.158.16                            : ok=4      changed=2      unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ vim /etc/ansible/hosts


ansadmin@svl200:~$ vim /etc/ssh/sshd_config
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible cible1 -m setup
146.59.158.16 | SUCCESS => {
        "ansible_facts": {
                "ansible_all_ipv4_addresses": [
                        "146.59.158.16"
                ],
                "ansible_all_ipv6_addresses": [
                        "2001:41d0:304:200::951d",
                        "fe80::f816:3eff:fee6:102e"
                ],
                "ansible_apparmor": {
                        "status": "enabled"
                },
                "ansible_architecture": "x86_64",
                "ansible_bios_date": "04/01/2014",
                "ansible_bios_version": "2:1.10.2-58953eb7",
                "ansible_cmdline": {
                        "BOOT_IMAGE": "/boot/vmlinuz-5.4.0-122-generic",
                        "console": "ttyS0",
                        "ro": true,
                        "root": "LABEL=cloudimg-rootfs"
                },
                "ansible_date_time": {
                        "date": "2022-10-03",
                        "day": "03",
                        "epoch": "1664805080",
                        "hour": "13",
                        "iso8601": "2022-10-03T13:51:20Z",
                        "iso8601_basic": "20221003T135120753276",
                        "iso8601_basic_short": "20221003T135120",
                        "iso8601_micro": "2022-10-03T13:51:20.753373Z",
                        "minute": "51",
                        "month": "10",
                        "second": "20",
                        "time": "13:51:20",
                        "tz": "UTC",
                        "tz_offset": "+0000",
                        "weekday": "Monday",
                        "weekday_number": "1",
                        "weeknumber": "40",
                        "year": "2022"
                },
                "ansible_default_ipv4": {
                        "address": "146.59.158.16",
                        "alias": "ens3",
                        "broadcast": "global",
                        "gateway": "146.59.156.1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:e6:10:2e",
                        "mtu": 1500,
                        "netmask": "255.255.255.255",
                        "network": "146.59.158.16",
                        "type": "ether"
                },
                "ansible_default_ipv6": {
                        "address": "2001:41d0:304:200::951d",
                        "gateway": "2001:41d0:304:200::1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:e6:10:2e",
                        "mtu": 1500,
                        "prefix": "56",
                        "scope": "global",
                        "type": "ether"
                },
                "ansible_device_links": {
                        "ids": {
                                "sda": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0"
                                ],
                                "sda1": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-
part1"
                                ],
                                "sda14": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-
part14"
                                ],
                                "sda15": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-
part15"
                                ]
                        },
                        "labels": {
                                "sda1": [
                                        "cloudimg-rootfs"
                                ],
                                "sda15": [
                                        "UEFI"
                                ]
                        },
                        "masters": {},
                        "uuids": {
                                "sda1": [
                                        "f209b90d-e073-4df4-950a-9c8620c2292b"
                                ],
                                "sda15": [
                                        "C957-9CB6"
                                ]
                        }
                },
                "ansible_devices": {
                        "loop0": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "126888",
                                "sectorsize": "512",
                                "size": "61.96 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop1": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "96176",
                                "sectorsize": "512",
                                "size": "46.96 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop10": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "98272",
                                "sectorsize": "512",
                                "size": "47.98 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop11": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "0",
                                "sectorsize": "512",
                                "size": "0.00 Bytes",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop2": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "138880",
                                "sectorsize": "512",
                                "size": "67.81 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop3": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "126888",
                                "sectorsize": "512",
                                "size": "61.96 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop4": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "233448",
                                "sectorsize": "512",
                                "size": "113.99 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop5": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "8688",
                                "sectorsize": "512",
                                "size": "4.24 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop6": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "129480",
                                "sectorsize": "512",
                                "size": "63.22 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop7": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "98288",
                                "sectorsize": "512",
                                "size": "47.99 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop8": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "235368",
                                "sectorsize": "512",
                                "size": "114.93 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop9": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "235496",
                                "sectorsize": "512",
                                "size": "114.99 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "sda": {
                                "holders": [],
                                "host": "SCSI storage controller: Red Hat, Inc.
Virtio SCSI",
                                "links": {
                                        "ids": [
                                                "scsi-0QEMU_QEMU_HARDDISK_drive-
scsi0-0-0-0"
                                        ],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": "QEMU HARDDISK",
                                "partitions": {
                                        "sda1": {
                                                "holders": [],
                                                "links": {
                                                        "ids": [
                                                                "scsi-
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-part1"
                                                        ],
                                                        "labels": [
                                                                "cloudimg-rootfs"
                                                        ],
                                                        "masters": [],
                                                        "uuids": [
                                                                "f209b90d-e073-4df4-
950a-9c8620c2292b"
                                                        ]
                                                },
                                                "sectors": "83658719",
                                                "sectorsize": 512,
                                                "size": "39.89 GB",
                                                "start": "227328",
                                                "uuid": "f209b90d-e073-4df4-950a-
9c8620c2292b"
                                        },
                                        "sda14": {
                                                "holders": [],
                                                "links": {
                                                        "ids": [
                                                                "scsi-
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-part14"
                                                        ],
                                                        "labels": [],
                                                        "masters": [],
                                                        "uuids": []
                                                },
                                                "sectors": "8192",
                                                "sectorsize": 512,
                                                "size": "4.00 MB",
                                                "start": "2048",
                                                "uuid": null
                                        },
                                        "sda15": {
                                                "holders": [],
                                                "links": {
                                                        "ids": [
                                                                "scsi-
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-part15"
                                                        ],
                                                        "labels": [
                                                                "UEFI"
                                                        ],
                                                        "masters": [],
                                                        "uuids": [
                                                                "C957-9CB6"
                                                        ]
                                                },
                                                "sectors": "217088",
                                                "sectorsize": 512,
                                                "size": "106.00 MB",
                                                "start": "10240",
                                                "uuid": "C957-9CB6"
                                        }
                                },
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "83886080",
                                "sectorsize": "512",
                                "size": "40.00 GB",
                                "support_discard": "4096",
                                "vendor": "QEMU",
                                "virtual": 1
                        }
                },
                "ansible_distribution": "Ubuntu",
                "ansible_distribution_file_parsed": true,
                "ansible_distribution_file_path": "/etc/os-release",
                "ansible_distribution_file_variety": "Debian",
                "ansible_distribution_major_version": "20",
                "ansible_distribution_release": "focal",
                "ansible_distribution_version": "20.04",
                "ansible_dns": {
                        "nameservers": [
                                "127.0.0.53"
                        ],
                        "options": {
                                "edns0": true,
                                "trust-ad": true
                        },
                        "search": [
                                "openstacklocal"
                        ]
                },
                "ansible_domain": "vps.ovh.net",
                "ansible_effective_group_id": 1006,
                "ansible_effective_user_id": 1006,
                "ansible_ens3": {
                        "active": true,
                        "device": "ens3",
                        "features": {
                                "esp_hw_offload": "off [fixed]",
                                "esp_tx_csum_hw_offload": "off [fixed]",
                                "fcoe_mtu": "off [fixed]",
                                "generic_receive_offload": "on",
                                "generic_segmentation_offload": "on",
                                "highdma": "on [fixed]",
                                "hw_tc_offload": "off [fixed]",
                                "l2_fwd_offload": "off [fixed]",
                                "large_receive_offload": "off [fixed]",
                                "loopback": "off [fixed]",
                                "netns_local": "off [fixed]",
                                "ntuple_filters": "off [fixed]",
                                "receive_hashing": "off [fixed]",
                                "rx_all": "off [fixed]",
                                "rx_checksumming": "on [fixed]",
                                "rx_fcs": "off [fixed]",
                                "rx_gro_hw": "on",
                                "rx_udp_tunnel_port_offload": "off [fixed]",
                                "rx_vlan_filter": "on [fixed]",
                                "rx_vlan_offload": "off [fixed]",
                                "rx_vlan_stag_filter": "off [fixed]",
                                "rx_vlan_stag_hw_parse": "off [fixed]",
                                "scatter_gather": "on",
                                "tcp_segmentation_offload": "on",
                                "tls_hw_record": "off [fixed]",
                                "tls_hw_rx_offload": "off [fixed]",
                                "tls_hw_tx_offload": "off [fixed]",
                                "tx_checksum_fcoe_crc": "off [fixed]",
                                "tx_checksum_ip_generic": "on",
                                "tx_checksum_ipv4": "off [fixed]",
                                "tx_checksum_ipv6": "off [fixed]",
                                "tx_checksum_sctp": "off [fixed]",
                                "tx_checksumming": "on",
                                "tx_esp_segmentation": "off [fixed]",
                                "tx_fcoe_segmentation": "off [fixed]",
                                "tx_gre_csum_segmentation": "off [fixed]",
                                "tx_gre_segmentation": "off [fixed]",
                                "tx_gso_partial": "off [fixed]",
                                "tx_gso_robust": "on [fixed]",
                                "tx_ipxip4_segmentation": "off [fixed]",
                                "tx_ipxip6_segmentation": "off [fixed]",
                                "tx_lockless": "off [fixed]",
                                "tx_nocache_copy": "off",
                                "tx_scatter_gather": "on",
                                "tx_scatter_gather_fraglist": "off [fixed]",
                                "tx_sctp_segmentation": "off [fixed]",
                                "tx_tcp6_segmentation": "on",
                                "tx_tcp_ecn_segmentation": "on",
                                "tx_tcp_mangleid_segmentation": "off",
                                "tx_tcp_segmentation": "on",
                                "tx_udp_segmentation": "off [fixed]",
                                "tx_udp_tnl_csum_segmentation": "off [fixed]",
                                "tx_udp_tnl_segmentation": "off [fixed]",
                                "tx_vlan_offload": "off [fixed]",
                                "tx_vlan_stag_hw_insert": "off [fixed]",
                                "vlan_challenged": "off [fixed]"
                        },
                        "hw_timestamp_filters": [],
                        "ipv4": {
                                "address": "146.59.158.16",
                                "broadcast": "global",
                                "netmask": "255.255.255.255",
                                "network": "146.59.158.16"
                        },
                        "ipv6": [
                                {
                                        "address": "2001:41d0:304:200::951d",
                                        "prefix": "56",
                                        "scope": "global"
                                },
                                {
                                        "address": "fe80::f816:3eff:fee6:102e",
                                        "prefix": "64",
                                        "scope": "link"
                                }
                        ],
                        "macaddress": "fa:16:3e:e6:10:2e",
                        "module": "virtio_net",
                        "mtu": 1500,
                        "pciid": "virtio0",
                        "promisc": false,
                        "speed": -1,
                        "timestamping": [
                                "tx_software",
                                "rx_software",
                                "software"
                        ],
                        "type": "ether"
                },
                "ansible_env": {
                        "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1006/bus",
                        "HOME": "/home/ansadmin",
                        "LANG": "C.UTF-8",
                        "LOGNAME": "ansadmin",
                        "MOTD_SHOWN": "pam",
                        "PATH":
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:     
/usr/local/games:/snap/bin",
                        "PWD": "/home/ansadmin",
                        "SHELL": "/bin/bash",
                        "SHLVL": "0",
                        "SSH_CLIENT": "146.59.156.114 35036 55600",
                        "SSH_CONNECTION": "146.59.156.114 35036 146.59.158.16 55600",
                        "SSH_TTY": "/dev/pts/2",
                        "TERM": "xterm",
                        "USER": "ansadmin",
                        "XDG_RUNTIME_DIR": "/run/user/1006",
                        "XDG_SESSION_CLASS": "user",
                        "XDG_SESSION_ID": "468",
                        "XDG_SESSION_TYPE": "tty",
                        "_": "/bin/sh"
                },
                "ansible_fibre_channel_wwn": [],
                "ansible_fips": false,
                "ansible_form_factor": "Other",
                "ansible_fqdn": "vps-698c29b2.vps.ovh.net",
                "ansible_hostname": "master-wildfly",
                "ansible_hostnqn": "",
                "ansible_interfaces": [
                        "lo",
                        "ens3"
                ],
                "ansible_is_chroot": false,
                "ansible_iscsi_iqn": "",
                "ansible_kernel": "5.4.0-122-generic",
                "ansible_kernel_version": "#138-Ubuntu SMP Wed Jun 22 15:00:31 UTC
2022",
                "ansible_lo": {
                        "active": true,
                        "device": "lo",
                        "features": {
                                "esp_hw_offload": "off [fixed]",
                                "esp_tx_csum_hw_offload": "off [fixed]",
                                "fcoe_mtu": "off [fixed]",
                                "generic_receive_offload": "on",
                                "generic_segmentation_offload": "on",
                                "highdma": "on [fixed]",
                                "hw_tc_offload": "off [fixed]",
                                "l2_fwd_offload": "off [fixed]",
                                "large_receive_offload": "off [fixed]",
                                "loopback": "on [fixed]",
                                "netns_local": "on [fixed]",
                                "ntuple_filters": "off [fixed]",
                                "receive_hashing": "off [fixed]",
                                "rx_all": "off [fixed]",
                                "rx_checksumming": "on [fixed]",
                                "rx_fcs": "off [fixed]",
                                "rx_gro_hw": "off [fixed]",
                                "rx_udp_tunnel_port_offload": "off [fixed]",
                                "rx_vlan_filter": "off [fixed]",
                                "rx_vlan_offload": "off [fixed]",
                                "rx_vlan_stag_filter": "off [fixed]",
                                "rx_vlan_stag_hw_parse": "off [fixed]",
                                "scatter_gather": "on",
                                "tcp_segmentation_offload": "on",
                                "tls_hw_record": "off [fixed]",
                                "tls_hw_rx_offload": "off [fixed]",
                                "tls_hw_tx_offload": "off [fixed]",
                                "tx_checksum_fcoe_crc": "off [fixed]",
                                "tx_checksum_ip_generic": "on [fixed]",
                                "tx_checksum_ipv4": "off [fixed]",
                                "tx_checksum_ipv6": "off [fixed]",
                                "tx_checksum_sctp": "on [fixed]",
                                "tx_checksumming": "on",
                                "tx_esp_segmentation": "off [fixed]",
                                "tx_fcoe_segmentation": "off [fixed]",
                                "tx_gre_csum_segmentation": "off [fixed]",
                                "tx_gre_segmentation": "off [fixed]",
                                "tx_gso_partial": "off [fixed]",
                                "tx_gso_robust": "off [fixed]",
                                "tx_ipxip4_segmentation": "off [fixed]",
                                "tx_ipxip6_segmentation": "off [fixed]",
                                "tx_lockless": "on [fixed]",
                                "tx_nocache_copy": "off [fixed]",
                                "tx_scatter_gather": "on [fixed]",
                                "tx_scatter_gather_fraglist": "on [fixed]",
                                "tx_sctp_segmentation": "on",
                                "tx_tcp6_segmentation": "on",
                                "tx_tcp_ecn_segmentation": "on",
                                "tx_tcp_mangleid_segmentation": "on",
                                "tx_tcp_segmentation": "on",
                                "tx_udp_segmentation": "off [fixed]",
                                "tx_udp_tnl_csum_segmentation": "off [fixed]",
                                "tx_udp_tnl_segmentation": "off [fixed]",
                                "tx_vlan_offload": "off [fixed]",
                                "tx_vlan_stag_hw_insert": "off [fixed]",
                                "vlan_challenged": "on [fixed]"
                        },
                        "hw_timestamp_filters": [],
                        "ipv4": {
                                "address": "127.0.0.1",
                                "broadcast": "host",
                                "netmask": "255.0.0.0",
                                "network": "127.0.0.0"
                        },
                        "ipv6": [
                                {
                                        "address": "::1",
                                        "prefix": "128",
                                        "scope": "host"
                                }
                        ],
                        "mtu": 65536,
                        "promisc": false,
                        "timestamping": [
                                "tx_software",
                                "rx_software",
                                "software"
                        ],
                        "type": "loopback"
                },
                "ansible_local": {},
                "ansible_lsb": {
                        "codename": "focal",
                        "description": "Ubuntu 20.04.5 LTS",
                        "id": "Ubuntu",
                        "major_release": "20",
                        "release": "20.04"
                },
                "ansible_machine": "x86_64",
                "ansible_machine_id": "adc4dbb14d4447ada17154213d422c09",
                "ansible_memfree_mb": 222,
                "ansible_memory_mb": {
                        "nocache": {
                                "free": 1278,
                                "used": 657
                        },
                        "real": {
                                "free": 222,
                                "total": 1935,
                                "used": 1713
                        },
                        "swap": {
                                "cached": 0,
                                "free": 0,
                                "total": 0,
                                "used": 0
                        }
                },
                "ansible_memtotal_mb": 1935,
                "ansible_mounts": [
                        {
                                "block_available": 8921537,
                                "block_size": 4096,
                                "block_total": 10114671,
                                "block_used": 1193134,
                                "device": "/dev/sda1",
                                "fstype": "ext4",
                                "inode_available": 5046647,
                                "inode_total": 5160960,
                                "inode_used": 114313,
                                "mount": "/",
                                "options": "rw,relatime",
                                "size_available": 36542615552,
                                "size_total": 41429692416,
                                "uuid": "f209b90d-e073-4df4-950a-9c8620c2292b"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 543,
                                "block_used": 543,
                                "device": "/dev/loop2",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 802,
                                "inode_used": 802,
                                "mount": "/snap/lxd/22753",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 71172096,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 203074,
                                "block_size": 512,
                                "block_total": 213716,
                                "block_used": 10642,
                                "device": "/dev/sda15",
                                "fstype": "vfat",
                                "inode_available": 0,
                                "inode_total": 0,
                                "inode_used": 0,
                                "mount": "/boot/efi",
                                "options":
"rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-     
1,shortname=mixed,errors=remount-ro",
                                "size_available": 103973888,
                                "size_total": 109422592,
                                "uuid": "C957-9CB6"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 496,
                                "block_used": 496,
                                "device": "/dev/loop3",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 11796,
                                "inode_used": 11796,
                                "mount": "/snap/core20/1611",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 65011712,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 34,
                                "block_used": 34,
                                "device": "/dev/loop5",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 690,
                                "inode_used": 690,
                                "mount": "/snap/tree/18",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 4456448,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 506,
                                "block_used": 506,
                                "device": "/dev/loop6",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 11882,
                                "inode_used": 11882,
                                "mount": "/snap/core20/1623",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 66322432,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 384,
                                "block_used": 384,
                                "device": "/dev/loop7",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 486,
                                "inode_used": 486,
                                "mount": "/snap/snapd/16778",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 50331648,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 920,
                                "block_used": 920,
                                "device": "/dev/loop8",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 12845,
                                "inode_used": 12845,
                                "mount": "/snap/core/13741",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 120586240,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 920,
                                "block_used": 920,
                                "device": "/dev/loop9",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 12845,
                                "inode_used": 12845,
                                "mount": "/snap/core/13886",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 120586240,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 384,
                                "block_used": 384,
                                "device": "/dev/loop10",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 486,
                                "inode_used": 486,
                                "mount": "/snap/snapd/17029",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 50331648,
                                "uuid": "N/A"
                        }
                ],
                "ansible_nodename": "master-wildfly",
                "ansible_os_family": "Debian",
                "ansible_pkg_mgr": "apt",
                "ansible_proc_cmdline": {
                        "BOOT_IMAGE": "/boot/vmlinuz-5.4.0-122-generic",
                        "console": [
                                "tty1",
                                "ttyS0"
                        ],
                        "ro": true,
                        "root": "LABEL=cloudimg-rootfs"
                },
                "ansible_processor": [
                        "0",
                        "GenuineIntel",
                        "Intel Core Processor (Haswell, no TSX)"
                ],
                "ansible_processor_cores": 1,
                "ansible_processor_count": 1,
                "ansible_processor_threads_per_core": 1,
                "ansible_processor_vcpus": 1,
                "ansible_product_name": "OpenStack Nova",
                "ansible_product_serial": "NA",
                "ansible_product_uuid": "NA",
                "ansible_product_version": "19.0.4",
                "ansible_python": {
                        "executable": "/usr/bin/python3",
                        "has_sslcontext": true,
                        "type": "cpython",
                        "version": {
                                "major": 3,
                                "micro": 10,
                                "minor": 8,
                                "releaselevel": "final",
                                "serial": 0
                        },
                        "version_info": [
                                3,
                                8,
                                10,
                                "final",
                                0
                        ]
                },
                "ansible_python_version": "3.8.10",
                "ansible_real_group_id": 1006,
                "ansible_real_user_id": 1006,
                "ansible_selinux": {
                        "status": "Missing selinux Python library"
                },
                "ansible_selinux_python_present": false,
                "ansible_service_mgr": "systemd",
                "ansible_ssh_host_key_dsa_public":
"AAAAB3NzaC1kc3MAAACBAP6HcF8z3pABr7Ha4Z/hiKaYFifKH     
BMqCxMrB4joQeAx3e/OA93XudbdbwRmW2GtjdJf9mvVOjbvHZr44KAITI65I+MzAWn/
Bhx0cMyljGJJDyXFSQqzuwmzLg     
XHbHnPAhw93kp1Ct1NOgEBTnwbhVzaQhEDQ6pmHCj/NIRyCFwLAAAAFQCPsGFnGGnYxsX59fhj2Aymc7tsfwA
AAIB7qfB     
O5uJoTj2nu3mbAVI8BuVRpGS4hBUctkR1pmvTkNbKJzAxrFDynG9fMx2LKsgIqjCgNFk0YahxigpGRJuLOe3L
6b0ymXGj     
QzJ2dvyB7ghpTLbRxgJa+MiZJuJlrztCrtrIjvxF1H9y2J7dLlwF9F6GsZAFCpm7uQKcLOpgDgAAAIEAoD+6L
4p4aFw7I     
ev0y+ehe3JCxLLC5NvblMLDGvqkA098r1EUCWSowH24IeFRHJ+cdWtcArJNclJDaNA8oePwjuQKtubQyr4W8O
1VYTYw3z      P3W6qFDeFl5yLKA9EHUmxWc8ymXDGBcmwuVH2W1ZbteSSpKS1Ycp8OxzXqEalRrYc=",
                "ansible_ssh_host_key_ecdsa_public":
"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTY     
AAABBBOn8ceAE4EDAWwmXkogeKexuv0b82zK+3VenUUR8P2cicoaQSsQ83fldYHzqhVSP5x98ZhqkHaHMgBkS
MZY8rBQ=      ",
                "ansible_ssh_host_key_ed25519_public":
"AAAAC3NzaC1lZDI1NTE5AAAAIM0bpK+LEEg6bH+uMeDKA      HlvcQHBfj37qCeWUF+pS2uQ",
                "ansible_ssh_host_key_rsa_public":
"AAAAB3NzaC1yc2EAAAADAQABAAABgQDByfqYTpZnEJQpKILW/     
ELvPYKwSedP1hbHtGGEEymgw0dWhkKahKqNITSTPBF/0pALPm+3/IKONDAUr53cZQLngFrV+qu8rnKdaRo3OX
DZzJrWeR     
ZVmlyQTmF+uA8L3e+IJitvPPm+7Aj7SrbwfBqCPLNdEfN1ausTQZK/hIPCgOfAV2Yswr93nqtOSiiybhZ6lQx
e2KsDbh1     
XRjFUb4tgIUkt1Hbb3x22uqL4BAZ0htJ3EsDkwUv1VwTOc/CVs0IZryQZH1nEXJakk3z8Ibte2f75jIe1A1Vt
rYw6zQLp     
8HxkGs9S4YWxQJpeJ6k9bYRJ+SF+UPS3gchon+A2rOuaOSYMUCh9RH2g8DoIDawP7BPX38HTsgu6RPciz5nb2
oDJ0iCWF     
t8Zfj4rwGoigcYBWQ5NkBWHK1GpGs0wdt0VbiUlF2SzEDgJmESOn2bhyiXhoT/2OaX5lViPyjzr3NGVOO6z7V
j3HBEBqX      F4+y/c4b08NiiucMDDp3CjQ5JtClE=",
                "ansible_swapfree_mb": 0,
                "ansible_swaptotal_mb": 0,
                "ansible_system": "Linux",
                "ansible_system_capabilities": [
                        ""
                ],
                "ansible_system_capabilities_enforced": "True",
                "ansible_system_vendor": "OpenStack Foundation",
                "ansible_uptime_seconds": 3303036,
                "ansible_user_dir": "/home/ansadmin",
                "ansible_user_gecos": ",,,",
                "ansible_user_gid": 1006,
                "ansible_user_id": "ansadmin",
                "ansible_user_shell": "/bin/bash",
                "ansible_user_uid": 1006,
                "ansible_userspace_architecture": "x86_64",
                "ansible_userspace_bits": "64",
                "ansible_virtualization_role": "guest",
                "ansible_virtualization_type": "openstack",
                "discovered_interpreter_python": "/usr/bin/python3",
                "gather_subset": [
                        "all"
                ],
                "module_setup": true
        },
        "changed": false
}
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible cible1 -m setup -a "filter=*family*"
146.59.158.16 | SUCCESS => {
        "ansible_facts": {
                "ansible_os_family": "Debian",
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false
}
ansadmin@svl200:~$ ansible cible2 -m setup -a "filter=*family*"
141.95.160.133 | SUCCESS => {
        "ansible_facts": {
                "ansible_os_family": "Debian",
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible cible2 -m setup -a "filter=*ip*"
141.95.160.133 | SUCCESS => {
        "ansible_facts": {
                "ansible_all_ipv4_addresses": [
                        "141.95.160.133"
                ],
                "ansible_all_ipv6_addresses": [
                        "2001:41d0:304:200::82a1",
                        "fe80::f816:3eff:fef2:cdf9"
                ],
                "ansible_default_ipv4": {
                        "address": "141.95.160.133",
                        "alias": "ens3",
                        "broadcast": "global",
                        "gateway": "141.95.160.1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:f2:cd:f9",
                        "mtu": 1500,
                        "netmask": "255.255.255.255",
                        "network": "141.95.160.133",
                        "type": "ether"
                },
                "ansible_default_ipv6": {
                        "address": "2001:41d0:304:200::82a1",
                        "gateway": "2001:41d0:304:200::1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:f2:cd:f9",
                        "mtu": 1500,
                        "prefix": "56",
                        "scope": "global",
                        "type": "ether"
                },
                "ansible_fips": false,
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false
}
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ cat fact.yaml
---
- name: facts
    hosts: all
    become: true
    vars:
        - var1: Hello DevOps1
        - var2: Good Morning DevOps2

    tasks:
        - name: echo text
            shell: echo "{{var1}} is var1, but var2 is {{var2}} >
/home/ansadmin/{{ansible_os_family}}
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ ansible-playbook fact.yaml

PLAY [facts]
***********************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


*******************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        resc      ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        resc      ignored=0
ansadmin@svl200:~$ ansible all -a "ls -lrt"
146.59.158.16 | CHANGED | rc=0 >>
total 8
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
141.95.160.133 | CHANGED | rc=0 >>
total 8
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
ansadmin@svl200:~$ ansible all -a "cat Redhat.txt"
146.59.158.16 | FAILED | rc=1 >>
cat: Redhat.txt: No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=1 >>
cat: Redhat.txt: No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -a "cat RedHat.txt"
146.59.158.16 | FAILED | rc=1 >>
cat: RedHat.txt: No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=1 >>
cat: RedHat.txt: No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -a "cat Debian.txt"
146.59.158.16 | CHANGED | rc=0 >>
Hello DevOps1 is var1, but var2 is Good Morning DevOps2
141.95.160.133 | CHANGED | rc=0 >>
Hello DevOps1 is var1, but var2 is Good Morning DevOps2
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ cp fact.yaml fact1.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim ip.txt
ansadmin@svl200:~$ ansible-playbook fact1.yaml

PLAY [facts]
***********************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


*******************************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variabe error was: 'ip' is undefined\n\nThe error appears to be in
'/home/ansadmin/fact1.yaml': line 9mn 7, but may\nbe elsewhere in the file depending
on the exact syntax problem.\n\nThe offending ppears to be:\n\n    tasks:\n        -
name: echo text\n            ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined variahe error was: 'ip' is undefined\n\nThe error appears to be in
'/home/ansadmin/fact1.yaml': line umn 7, but may\nbe elsewhere in the file depending
on the exact syntax problem.\n\nThe offendingappears to be:\n\n    tasks:\n        -
name: echo text\n            ^ here\n"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc      ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc      ignored=0

ansadmin@svl200:~$ sudo vim fact1.yaml


ansadmin@svl200:~$ ansible-playbook fact1.yaml

PLAY [facts]
***********************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


*******************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        resc      ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        resc      ignored=0

ansadmin@svl200:~$ sudo vim fact1.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook fact1.yaml

PLAY [facts]
***********************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


*******************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        resc      ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        resc      ignored=0
ansadmin@svl200:~$ sudo vim ip.txt
ansadmin@svl200:~$ cat ip.txt
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ ansible all -a "cat ip.txt"
146.59.158.16 | CHANGED | rc=0 >>
['146.59.158.16']
141.95.160.133 | CHANGED | rc=0 >>
['141.95.160.133']
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ cat debug.yaml
---
-name: debug
hosts: cible1
become: true
vars:
      - var1: Hello Devops

tasks:
      - name: echo test
          command: echo -e "{{var1}} is var1 it works"
          register: results

      - name: show results


          debug: msg={{results}}

ansadmin@svl200:~$ ansible-playbook debug.yaml


ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/debug.yaml': line 3, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

-name: debug
hosts: cible1
            ^ here
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ ansible-playbook debug.yaml

PLAY [debug]
**********************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]

TASK [echo test]


******************************************************************************
changed: [146.59.158.16]

TASK [show results]


***************************************************************************
ok: [146.59.158.16] => {
        "msg": {
                "changed": true,
                "cmd": [
                        "echo",
                        "-e",
                        "Hello Devops is var1 it works"
                ],
                "delta": "0:00:00.003328",
                "end": "2022-10-03 15:01:22.526831",
                "failed": false,
                "rc": 0,
                "start": "2022-10-03 15:01:22.523503",
                "stderr": "",
                "stderr_lines": [],
                "stdout": "Hello Devops is var1 it works",
                "stdout_lines": [
                        "Hello Devops is var1 it works"
                ]
        }
}

PLAY RECAP
************************************************************************************
146.59.158.16                            : ok=3      changed=1      unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim debug.yaml


ansadmin@svl200:~$ ansible-playbook debug.yaml

PLAY [debug]
**********************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]

TASK [echo test]


******************************************************************************
changed: [146.59.158.16]

TASK [show results]


***************************************************************************
ok: [146.59.158.16] => {
        "msg": [
                "Hello Devops is var1 it works"
        ]
}

PLAY RECAP
************************************************************************************
146.59.158.16                            : ok=3      changed=1      unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp debug.yaml debug1.yaml
ansadmin@svl200:~$ sudo vim debug1.yaml
ansadmin@svl200:~$ ansible-playbook debug1.yaml

PLAY [debug]
**********************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]

TASK [show results]


***************************************************************************
ok: [146.59.158.16] => {
        "msg": "Le serveur Apache utilise par defaut le port 80 sur ma machine
Debian"
}

PLAY RECAP
************************************************************************************
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


****************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


****************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [apt get install httpd on centos]


********************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [apt-get install httpd on centos]


********************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


****************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


****************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
...ignoring
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
...ignoring

TASK [install apache2 on ubuntu]


**************************************************************
ok: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=3      changed=1      unreachable=0   
failed=0        skipped=0        res cued=0        ignored=1
146.59.158.16                            : ok=3      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=1

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$ -
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
──────────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Mon Oct    3 13:16:15 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$ sudo vim when.yml
ansadmin@svl200:~$ history
        1    ssh-keygen -t rsa
        2    ssh
        3    ssh-copy-id ansadmin@146.59.156.114ssh-copy-id ansadmin@146.59.156.114
        4    sudo vim /etc/ssh/sshd_config
        5    ls -l .ssh/
        6    ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub ansadmin@146.59.158.16 -p
55600
        7    ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub ansadmin@141.95.160.133 -p
55600
        8    sudo vim /etc/ansible/hosts
        9    ansible all -m ping
      10    sudo vim /etc/ansible/hosts
      11    ansible all -m ping
      12    ansible cible1 -m ping
      13    ansible cible2 -m ping
      14    ansible 146.59.158.16 -m ping
      15    ansible 141.95.160.133 -m ping
      16    sudo touch cible1.txt
      17    ansible cible1 -m copy -a "src=cible1.txt dest=/tmp"
      18    ansible cible1 -m ls -a "dest=/tmp"
      19    ansible cible1 -m shell -a "ls -lrt /tmp"
      20    ansible cible1 -m file -a "dest=/tmp/cible1.txt mode=777"
      21    ansible cible1 -m user -a "name=cible1 state=present"
      22    ansible cible1 -b -m user -a "name=cible1 state=present"
      23    ansible cible1 -m shell -a "cat /etc/passwd | grep cible1"
      24    ansible all -b -m apt -a "name=curl state=latest"
      25    ansible cible1 -m service -a "name=cron state=started"
      26    ansible cible1 -b -m service -a "name=cron state=started"
      27    ansible cible1 -b -m service -a "name=cron state=stopped"
      28    ansible cible1 -b -m systemd -a "name=cron state=started"
      29    ansible cible1 -b -m systemd -a "name=cron state=stopped"
      30    ansible cible1 -b -m systemd -a "name=cron state=restarted"
      31    ansible all -a 'whoami'
      32    ansible cible1 -a 'whoami'
      33    ansible cible2 -a 'whoami'
      34    ansible all -ab 'whoami'
      35    ansible all -b -a 'whoami'
      36    ansible all -ba 'whoami'
      37    sudo vim nginx.yaml
      38    ansible-playbook nginx.yml
      39    ansible-playbook nginx.yaml
      40    sudo vim nginx.yaml
      41    ansible all -m service -a "name=apache2 state=status"
      42    ansible cible1 -bm shell -a "systemctl status cron"
      43    uname -a
      44    uname -r
      45    cat /etc/os-release
      46    lsb_release
      47    ansible all -a "cat /ho
      48    sudo vim shell.yml
      49    ansible all -a "cat /home/ansadmin/resultat.txt"
      50    ansible-playbook resultat.txt
      51    sudo vim shell.yml
      52    ansible-playbook /home/ansadmin/resultat.txt
      53    sudo vim shell.yml
      54    ansible-playbook shell.yml
      55    ansible all -a "cat /home/ansadmin/resultat.txt"
      56    sudo vim shell.yml
      57    ansible-playbook shell.yml
      58    sudo vim shell.yml
      59    ansible-playbook shell.yml
      60    sudo vim shell.yml
      61    ansible-playbook shell.yml
      62    ansible-playbook -b shell.yml
      63    ansible all -a "cat /home/ansadmin/resultat.txt"
      64    sudo vim handler.yaml
      65    sudo vim handler.yaml
      66    vim handler.yaml
      67    sudo vim when.yml
      68    history
ansadmin@svl200:~$ ls
cible1.txt    debug1.yaml    fact1.yaml        index.html    nginx.yaml    when.yaml
debug.yaml    fact.yaml        handler.yaml    ip.txt            shell.yml
ansadmin@svl200:~$ sudo vim debug1.yaml
ansadmin@svl200:~$ ansible-playbook -b debug1.yaml

PLAY [debug]
**********************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
TASK [show results]
***************************************************************************
ok: [146.59.158.16] => {
        "msg": "Le serveur Apache utilise par defaut le port 80 sur ma machine
Debian"
}

PLAY RECAP
************************************************************************************
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


****************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1 664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::Op tions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' h as no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
candi date"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state informa tion...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    ng inx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04. 1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs 1
.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-http d 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-lig ht 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", " lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubuntu 3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserver 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
...ignoring
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time": 1664804313, "cache_updated": false, "changed": false, "msg":
"'/usr/bin/apt-get -y -o \"Dpkg::O ptions::=--force-confdef\" -o \"Dpkg::Options::=--
force-confold\"            install 'httpd'' failed: E: Package 'httpd' has no
installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no
installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation
cand idate"], "stdout": "Reading package lists...\nBuilding dependency tree...\
nReading state inform ation...\nPackage httpd is a virtual package provided by:\n   
nginx-light 1.18.0-0ubuntu1.3\n    n ginx-full 1.18.0-0ubuntu1.3\n    nginx-extras
1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.04 .1\n    nginx-core 1.18.0-
0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws 2.0.7+dfsg-1\n    webfs
1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver 2.16.0-2\n    mini-httpd
1.30-2\n    micro-htt pd 20140814-2\n\n", "stdout_lines": ["Reading package
lists...", "Building dependency tree...", "Reading state information...", "Package
httpd is a virtual package provided by:", "    nginx-li ght 1.18.0-0ubuntu1.3", "   
nginx-full 1.18.0-0ubuntu1.3", "    nginx-extras 1.18.0-0ubuntu1.3", "     lighttpd
1.4.55-1ubuntu1.20.04.1", "    nginx-core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-
4ubunt u3.12", "    yaws 2.0.7+dfsg-1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-
4build1", "    ocsigenserve r 2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd
20140814-2", ""]}
...ignoring

TASK [install apache2 on ubuntu]


**************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=3      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=1
146.59.158.16                            : ok=3      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=1

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$ sudo rm when1.yaml
rm: cannot remove 'when1.yaml': No such file or directory
ansadmin@svl200:~$ sudo rm -f when1.yaml
ansadmin@svl200:~$ ls
cible1.txt    debug1.yaml    fact1.yaml        index.html    nginx.yaml    when.yaml
debug.yaml    fact.yaml        handler.yaml    ip.txt            shell.yml
ansadmin@svl200:~$ sudo cp when.yaml when1.yaml
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$ ansible-playbook when1.yaml

PLAY [exemple avec condition when]


************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


****************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [install apache2 on ubuntu]


**************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      res cued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim list.yaml


ansadmin@svl200:~$ ansible-playbook list.yaml

PLAY [exemple ansible list]


*******************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install package]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ ansible-playbook items.yaml

PLAY [exemple avec items]


*********************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*********************************************************
changed: [146.59.158.16] => (item=init1.txt)
changed: [141.95.160.133] => (item=init1.txt)
changed: [146.59.158.16] => (item=init2.txt)
changed: [141.95.160.133] => (item=init2.txt)
changed: [146.59.158.16] => (item=init3.txt)
changed: [141.95.160.133] => (item=init3.txt)
changed: [146.59.158.16] => (item=init4.txt)
changed: [141.95.160.133] => (item=init4.txt)

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ ls
cible1.txt    debug1.yaml    fact1.yaml        index.html    items.yaml    nginx.yaml
when.yaml
debug.yaml    fact.yaml        handler.yaml    ip.txt            list.yaml     
shell.yml      when1.yaml
ansadmin@svl200:~$ ansible cible1 -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible cible1 -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible cible2 -bm shell -a "ls -lrt /home/ansadmin"
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible all -bma "ls -lrt /home/ansadmin"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT]
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: unrecognized arguments: ls -lrt /home/ansadmin
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ cp items.yaml seq.yaml
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ ansible-playbook seq.yaml
PLAY [exemple avec items]
*********************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*********************************************************
changed: [146.59.158.16] => (item=20)
changed: [141.95.160.133] => (item=20)
changed: [146.59.158.16] => (item=21)
changed: [141.95.160.133] => (item=21)
changed: [146.59.158.16] => (item=22)
changed: [141.95.160.133] => (item=22)
changed: [146.59.158.16] => (item=23)
changed: [141.95.160.133] => (item=23)
changed: [146.59.158.16] => (item=24)
changed: [141.95.160.133] => (item=24)
changed: [146.59.158.16] => (item=25)
changed: [141.95.160.133] => (item=25)
changed: [146.59.158.16] => (item=26)
changed: [141.95.160.133] => (item=26)
changed: [146.59.158.16] => (item=27)
changed: [141.95.160.133] => (item=27)

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"


146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
──────────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Mon Oct    3 17:50:31 2022 from 80.119.120.22
ofi03@svl200:~$
ofi03@svl200:~$ ansible all -bm group -a "name=rennes"
The authenticity of host '[146.59.158.16]:55600 ([146.59.158.16]:55600)' can't be
established.
ECDSA key fingerprint is SHA256:aQH+1UeVJklKq8A45Soa63iOGGkNRC/op7o5MgPiJtc.
The authenticity of host '[141.95.160.133]:55600 ([141.95.160.133]:55600)' can't be
established.
ECDSA key fingerprint is SHA256:XtY+kTiWN4Ohe3xBY3YAQ9YLSSuP7bbmxZjN/R9SBcs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
146.59.158.16 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: Warning: Permanently added
'[146.59.158.16]:5ickey,password).",
        "unreachable": true
}
^C [ERROR]: User interrupted execution
ofi03@svl200:~$
ofi03@svl200:~$ ansible all -bm group -a "name=rennes"
The authenticity of host '[141.95.160.133]:55600 ([141.95.160.133]:55600)' can't be
established.
ECDSA key fingerprint is SHA256:XtY+kTiWN4Ohe3xBY3YAQ9YLSSuP7bbmxZjN/R9SBcs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 146.59.158.16 |
UNREACHABLE
        "changed": false,
        "msg": "Failed to connect to the host via ssh: ofi03@146.59.158.16:
Permission denied (publi
        "unreachable": true
}
yes
141.95.160.133 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: Warning: Permanently added
'[141.95.160.133]:blickey,password).",
        "unreachable": true
}
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm group -a "name=rennes"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1008,
        "name": "rennes",
        "state": "present",
        "system": false
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1004,
        "name": "rennes",
        "state": "present",
        "system": false
}
ansadmin@svl200:~$ ansible all -bm group -a "name=lille"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1009,
        "name": "lille",
        "state": "present",
        "system": false
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1005,
        "name": "lille",
        "state": "present",
        "system": false
}
ansadmin@svl200:~$ ansible all -bm group -a "name=paris"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1010,
        "name": "paris",
        "state": "present",
        "system": false
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1006,
        "name": "paris",
        "state": "present",
        "system": false
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm user -a "name=core"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "comment": "",
        "create_home": true,
        "group": 1011,
        "home": "/home/core",
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "system": false,
        "uid": 1008
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "comment": "",
        "create_home": true,
        "group": 1007,
        "home": "/home/core",
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "system": false,
        "uid": 1004
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm user -a "name=core uid=10000"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1011,
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1007,
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm user -a "name=core groups=rennes"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1011,
        "groups": "rennes",
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1007,
        "groups": "rennes",
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm apt -a "name=tree state=latest"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "cache_update_time": 1664843277,
        "cache_updated": false,
        "changed": true,
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state information. 0 to remove and 0 not upgraded.\nNeed to get 43.0 kB of archives.\
nAfter this operation, 115 kBtu focal/universe amd64 tree amd64 1.8.0-1 [43.0 kB]\
nFetched 43.0 kB in 0s (133 kB/s)\nSelectin\r(Reading database ... 10%\r(Reading
database ... 15%\r(Reading database ... 20%\r(Reading data 40%\r(Reading database ...
45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading    ... 75%\
r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\
r(Readirectories currently installed.)\r\nPreparing to unpack .../tree_1.8.0-
1_amd64.deb ...\r\nUnpack (2.9.1-1) ...\r\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "The following NEW packages will be installed:",
                "    tree",
                "0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.",
                "Need to get 43.0 kB of archives.",
                "After this operation, 115 kB of additional disk space will be
used.",
                "Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu focal/universe
amd64 tree amd64 1.8.
                "Fetched 43.0 kB in 0s (133 kB/s)",
                "Selecting previously unselected package tree.",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97568 files and directories currently
installed.)",
                "Preparing to unpack .../tree_1.8.0-1_amd64.deb ...",
                "Unpacking tree (1.8.0-1) ...",
                "Setting up tree (1.8.0-1) ...",
                "Processing triggers for man-db (2.9.1-1) ..."
        ]
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "cache_update_time": 1664804313,
        "cache_updated": false,
        "changed": true,
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state information. 0 to remove and 18 not upgraded.\nNeed to get 43.0 kB of
archives.\nAfter this operation, 115 kntu focal/universe amd64 tree amd64 1.8.0-1
[43.0 kB]\nFetched 43.0 kB in 0s (129 kB/s)\nSelecti%\r(Reading database ... 10%\
r(Reading database ... 15%\r(Reading database ... 20%\r(Reading dat. 40%\r(Reading
database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Readinge ...
75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\
r(Readirectories currently installed.)\r\nPreparing to unpack .../tree_1.8.0-
1_amd64.deb ...\r\nUnpacb (2.9.1-1) ...\r\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "The following NEW packages will be installed:",
                "    tree",
                "0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.",
                "Need to get 43.0 kB of archives.",
                "After this operation, 115 kB of additional disk space will be
used.",
                "Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu focal/universe
amd64 tree amd64 1.8.
                "Fetched 43.0 kB in 0s (129 kB/s)",
                "Selecting previously unselected package tree.",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97537 files and directories currently
installed.)",
                "Preparing to unpack .../tree_1.8.0-1_amd64.deb ...",
                "Unpacking tree (1.8.0-1) ...",
                "Setting up tree (1.8.0-1) ...",
                "Processing triggers for man-db (2.9.1-1) ..."
        ]
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm service -a "name=cron state=stopped"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "cron",
        "state": "stopped",
        "status": {
                "ActiveEnterTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ActiveEnterTimestampMonotonic": "3297087651422",
                "ActiveExitTimestamp": "Mon 2022-10-03 12:11:21 UTC",
                "ActiveExitTimestampMonotonic": "3297037132653",
                "ActiveState": "active",
                "After": "nss-user-lookup.target system.slice systemd-journald.socket
remote-fs.target s
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "AssertTimestampMonotonic": "3297087645970",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner cap_e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_ cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ConditionTimestampMonotonic": "3297087645969",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlGroup": "/system.slice/cron.service",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "0",
                "ExecMainExitTimestampMonotonic": "0",
                "ExecMainPID": "253639",
                "ExecMainStartTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ExecMainStartTimestampMonotonic": "3297087647720",
                "ExecMainStatus": "0",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_erro
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags= ;
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestamp": "Mon 2022-10-03 12:11:21 UTC",
                "InactiveEnterTimestampMonotonic": "3297037133883",
                "InactiveExitTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "InactiveExitTimestampMonotonic": "3297087651422",
                "InvocationID": "1146685551e74a078e22588cc853b8b0",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "253639",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "2965504",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "system.slice sysinit.target",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "StateChangeTimestampMonotonic": "3297087651422",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "running",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "1",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "cron",
        "state": "stopped",
        "status": {
                "ActiveEnterTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ActiveEnterTimestampMonotonic": "15934843",
                "ActiveExitTimestampMonotonic": "0",
                "ActiveState": "active",
                "After": "nss-user-lookup.target basic.target sysinit.target systemd-
journald.socket rem
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "AssertTimestampMonotonic": "15930137",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner cap_e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_ cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ConditionTimestampMonotonic": "15930135",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlGroup": "/system.slice/cron.service",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "0",
                "ExecMainExitTimestampMonotonic": "0",
                "ExecMainPID": "679",
                "ExecMainStartTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ExecMainStartTimestampMonotonic": "15934762",
                "ExecMainStatus": "0",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_erro
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags= ;
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestampMonotonic": "0",
                "InactiveExitTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "InactiveExitTimestampMonotonic": "15934843",
                "InvocationID": "dcee66e33a3a4a47a8ce4148d9734e2f",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "679",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "6848512",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "sysinit.target system.slice",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "StateChangeTimestampMonotonic": "15934843",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "running",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "1",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm service -a "name=cron state=disabled"
146.59.158.16 | FAILED! => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "value of state must be one of: reloaded, restarted, started, stopped,
got: disabled"
}
141.95.160.133 | FAILED! => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "value of state must be one of: reloaded, restarted, started, stopped,
got: disabled"
}
ansadmin@svl200:~$ ansible all -bm service -a "name=cron enabled=no"
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "enabled": false,
        "name": "cron",
        "status": {
                "ActiveEnterTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ActiveEnterTimestampMonotonic": "15934843",
                "ActiveExitTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "ActiveExitTimestampMonotonic": "1719968363076",
                "ActiveState": "inactive",
                "After": "nss-user-lookup.target basic.target sysinit.target systemd-
journald.socket rem
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "AssertTimestampMonotonic": "15930137",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner cap_e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_ cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ConditionTimestampMonotonic": "15930135",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "2",
                "ExecMainExitTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "ExecMainExitTimestampMonotonic": "1719968363869",
                "ExecMainPID": "679",
                "ExecMainStartTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ExecMainStartTimestampMonotonic": "15934762",
                "ExecMainStatus": "15",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_erro] ; pid=679 ; code=killed ; status=15/TERM }",
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags= ; 679 ; code=killed ; status=15/TERM }",
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "InactiveEnterTimestampMonotonic": "1719968363887",
                "InactiveExitTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "InactiveExitTimestampMonotonic": "15934843",
                "InvocationID": "dcee66e33a3a4a47a8ce4148d9734e2f",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "0",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "[not set]",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "sysinit.target system.slice",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "StateChangeTimestampMonotonic": "1719968363887",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "dead",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "[not set]",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "enabled": false,
        "name": "cron",
        "status": {
                "ActiveEnterTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ActiveEnterTimestampMonotonic": "3297087651422",
                "ActiveExitTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "ActiveExitTimestampMonotonic": "3368914737265",
                "ActiveState": "inactive",
                "After": "nss-user-lookup.target system.slice systemd-journald.socket
remote-fs.target s
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "AssertTimestampMonotonic": "3297087645970",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner cap_e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_ cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ConditionTimestampMonotonic": "3297087645969",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "2",
                "ExecMainExitTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "ExecMainExitTimestampMonotonic": "3368914738115",
                "ExecMainPID": "253639",
                "ExecMainStartTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ExecMainStartTimestampMonotonic": "3297087647720",
                "ExecMainStatus": "15",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_erro] ; pid=253639 ; code=killed ; status=15/TERM }",
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags= ; 253639 ; code=killed ; status=15/TERM }",
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "InactiveEnterTimestampMonotonic": "3368914738600",
                "InactiveExitTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "InactiveExitTimestampMonotonic": "3297087651422",
                "InvocationID": "1146685551e74a078e22588cc853b8b0",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "0",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "[not set]",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "system.slice sysinit.target",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "StateChangeTimestampMonotonic": "3368914738600",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "dead",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "[not set]",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -m file -a "path=/tmp/test.txt state=touch mode=0644"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "dest": "/tmp/test.txt",
        "gid": 1006,
        "group": "ansadmin",
        "mode": "0644",
        "owner": "ansadmin",
        "size": 0,
        "state": "file",
        "uid": 1006
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "dest": "/tmp/test.txt",
        "gid": 1003,
        "group": "ansadmin",
        "mode": "0644",
        "owner": "ansadmin",
        "size": 0,
        "state": "file",
        "uid": 1003
}
ansadmin@svl200:~$ ansible all -m shell -a "ls -lrt /tmp/test.txt | grep test"
141.95.160.133 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin 0 Oct    4 08:16 /tmp/test.txt
146.59.158.16 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin 0 Oct    4 08:16 /tmp/test.txt
ansadmin@svl200:~$ ansible all -m shell -a "ls -lrt /tmp | grep test"
146.59.158.16 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
141.95.160.133 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -m directory -a "path=/tmp/dir state= mode=755"
146.59.158.16 | FAILED! => {
        "msg": "The module directory was not found in configured module paths"
}
141.95.160.133 | FAILED! => {
        "msg": "The module directory was not found in configured module paths"
}
ansadmin@svl200:~$ ansible all -m dir -a "path=/tmp/dir state= mode=755"
141.95.160.133 | FAILED! => {
        "msg": "The module dir was not found in configured module paths"
}
146.59.158.16 | FAILED! => {
        "msg": "The module dir was not found in configured module paths"
}
ansadmin@svl200:~$ ansible all -m file -a "path=/tmp/dir state=directory    mode=755"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1006,
        "group": "ansadmin",
        "mode": "0755",
        "owner": "ansadmin",
        "path": "/tmp/dir",
        "size": 4096,
        "state": "directory",
        "uid": 1006
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1003,
        "group": "ansadmin",
        "mode": "0755",
        "owner": "ansadmin",
        "path": "/tmp/dir",
        "size": 4096,
        "state": "directory",
        "uid": 1003
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm apt -a "name=* state=latest"
146.59.158.16 | SUCCESS => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "Reading package lists...\nBuilding dependency tree...\nReading state
information...\",
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state information..\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "Calculating upgrade...",
                "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."
        ]
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "msg": "Reading package lists...\nBuilding dependency tree...\nReading state
information...\n0 libnss-systemd libpam-systemd libsystemd0\n    libtss2-esys0
libudev1 motd-news-config netplan.syncd\n    ubuntu-advantage-tools ubuntu-release-
upgrader-core udev\n18 upgraded, 0 newly installen, 2594 kB disk space will be
freed.\nGet:1 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-uhive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.6
[60.4 kB]\nGet:3 ht245.4-4ubuntu3.18 [96.1 kB]\nGet:4
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/macom/ubuntu focal-
updates/main amd64 libudev1 amd64 245.4-4ubuntu3.18 [76.3 kB]\nGet:6
http://novntu3.18 [10.3 kB]\nGet:7 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 stu.com/ubuntu focal-updates/main amd64 libpam-systemd amd64
245.4-4ubuntu3.18 [186 kB]\nGet:9 htubuntu3.18 [3808 kB]\nGet:10
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main amd.com/ubuntu focal-
updates/main amd64 netplan.io amd64 0.104-0ubuntu2~20.04.2 [88.0 kB]\nGet:12 h104-
0ubuntu2~20.04.2 [82.5 kB]\nGet:13 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updateuds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-apt amd64
2.0.0ubuntu0.20.04.8 [1tu-advantage-tools amd64 27.10.1~20.04.1 [146 kB]\nGet:16
http://nova.clouds.archive.ubuntu.com/t:17
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-
distupgrade a/main amd64 libtss2-esys0 amd64 2.3.2-1ubuntu0.20.04.1 [226 kB]\
nPreconfiguring packages ...\nFeng database ... 10%\r(Reading database ... 15%\
r(Reading database ... 20%\r(Reading database ...eading database ... 45%\r(Reading
database ... 50%\r(Reading database ... 55%\r(Reading database\r(Reading database ...
80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading dataes currently
installed.)\r\nPreparing to unpack .../motd-news-config_11ubuntu5.6_all.deb ...\r\
n./base-files_11ubuntu5.6_amd64.deb ...\r\nWarning: Stopping motd-news.service, but
it can still u5.5) ...\r\nSetting up base-files (11ubuntu5.6) ...\r\nInstalling new
version of config file /ew version of config file /etc/lsb-release ...\r\nmotd-
news.service is a disabled or a static unie ... 10%\r(Reading database ... 15%\
r(Reading database ... 20%\r(Reading database ... 25%\r(Reaabase ... 45%\r(Reading
database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r database ...
80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 9ly
installed.)\r\nPreparing to unpack .../libnss-systemd_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpato unpack .../udev_245.4-4ubuntu3.18_amd64.deb ...\
r\nUnpacking udev (245.4-4ubuntu3.18) over (2\r\nUnpacking libudev1:amd64 (245.4-
4ubuntu3.18) over (245.4-4ubuntu3.17) ...\r\nSetting up libuReading database ... 10%\
r(Reading database ... 15%\r(Reading database ... 20%\r(Reading databas%\r(Reading
database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading dat.
75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\
r(Readingctories currently installed.)\r\nPreparing to unpack .../systemd-sysv_245.4-
4ubuntu3.18_amd64.dering to unpack .../systemd-timesyncd_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpacking systemd-timesystemd_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpacking libpam-systemd:amd64 (245.4-4ubuntu3.18)
over..\r\nUnpacking systemd (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...\r\
nPreparing to unpack untu3.18) over (245.4-4ubuntu3.17) ...\r\nSetting up
libsystemd0:amd64 (245.4-4ubuntu3.18) ...\ratabase ... 15%\r(Reading database ...
20%\r(Reading database ... 25%\r(Reading database ... 30%ng database ... 50%\
r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ...eading
database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading
databaseparing to unpack .../0-netplan.io_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\
nUnpacking netplan.io (bnetplan0_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\nUnpacking
libnetplan0:amd64 (0.104-0ubuntu2~20.0.0ubuntu0.20.04.8_all.deb ...\r\nUnpacking
python-apt-common (2.0.0ubuntu0.20.04.8) over (2.0..deb ...\r\nUnpacking python3-apt
(2.0.0ubuntu0.20.04.8) over (2.0.0ubuntu0.20.04.7) ...\r\nPrepbuntu-advantage-tools
(27.10.1~20.04.1) over (27.9~20.04.1) ...\r\nPreparing to unpack .../5-ubuore
(1:20.04.39) over (1:20.04.38) ...\r\nPreparing to unpack .../6-python3-
distupgrade_1%3a20.0reparing to unpack .../7-libtss2-esys0_2.3.2-
1ubuntu0.20.04.1_amd64.deb ...\r\nUnpacking libtss2tu5.6) ...\r\nSetting up libtss2-
esys0 (2.3.2-1ubuntu0.20.04.1) ...\r\nSetting up libnetplan0:amtramfs: deferring
update (trigger activated)\r\nSetting up python-apt-common (2.0.0ubuntu0.20.04grade
(1:20.04.39) ...\r\nSetting up ubuntu-release-upgrader-core (1:20.04.39) ...\r\
nSetting up..\r\nSetting up netplan.io (0.104-0ubuntu2~20.04.2) ...\r\nSetting up
systemd-timesyncd (245.4-systemd:amd64 (245.4-4ubuntu3.18) ...\r\nSetting up libpam-
systemd:amd64 (245.4-4ubuntu3.18) ...libc-bin (2.31-0ubuntu9.9) ...\r\nProcessing
triggers for man-db (2.9.1-1) ...\r\nProcessing tris: deferring update (trigger
activated)\r\nProcessing triggers for dbus (1.12.16-2ubuntu2.2) ...erating
/boot/initrd.img-5.4.0-126-generic\r\n",
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state information.plan0 libnss-systemd libpam-systemd libsystemd0\n    libtss2-esys0
libudev1 motd-news-config netplimesyncd\n    ubuntu-advantage-tools ubuntu-release-
upgrader-core udev\n18 upgraded, 0 newly instation, 2594 kB disk space will be
freed.\nGet:1 http://nova.clouds.archive.ubuntu.com/ubuntu
focaarchive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.6
[60.4 kB]\nGet:364 245.4-4ubuntu3.18 [96.1 kB]\nGet:4
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updatestu.com/ubuntu focal-
updates/main amd64 libudev1 amd64 245.4-4ubuntu3.18 [76.3 kB]\nGet:6
http://ubuntu3.18 [10.3 kB]\nGet:7 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd6buntu.com/ubuntu focal-updates/main amd64 libpam-systemd amd64
245.4-4ubuntu3.18 [186 kB]\nGet:94-4ubuntu3.18 [3808 kB]\nGet:10
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main ntu.com/ubuntu focal-
updates/main amd64 netplan.io amd64 0.104-0ubuntu2~20.04.2 [88.0 kB]\nGet:1 0.104-
0ubuntu2~20.04.2 [82.5 kB]\nGet:13 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updclouds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-apt amd64
2.0.0ubuntu0.20.04.8buntu-advantage-tools amd64 27.10.1~20.04.1 [146 kB]\nGet:16
http://nova.clouds.archive.ubuntu.cnGet:17
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-
distupgradtes/main amd64 libtss2-esys0 amd64 2.3.2-1ubuntu0.20.04.1 [226 kB]\
nPreconfiguring packages ...\ading database ... 10%\r(Reading database ... 15%\
r(Reading database ... 20%\r(Reading database r(Reading database ... 45%\r(Reading
database ... 50%\r(Reading database ... 55%\r(Reading datab75%\r(Reading database ...
80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading dories currently
installed.)\r\nPreparing to unpack .../motd-news-
config_11ubuntu5.6_all.deb ...\ .../base-files_11ubuntu5.6_amd64.deb ...\r\nWarning:
Stopping motd-news.service, but it can stiuntu5.5) ...\r\nSetting up base-files
(11ubuntu5.6) ...\r\nInstalling new version of config file new version of config file
/etc/lsb-release ...\r\nmotd-news.service is a disabled or a static base ... 10%\
r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\
r(database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading
database ... 60ing database ... 80%\r(Reading database ... 85%\r(Reading database ...
90%\r(Reading database ..ently installed.)\r\nPreparing to unpack .../libnss-
systemd_245.4-4ubuntu3.18_amd64.deb ...\r\nUng to unpack .../udev_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpacking udev (245.4-4ubuntu3.18) over...\r\nUnpacking
libudev1:amd64 (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...\r\nSetting up l\
r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\
r(Reading data 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading
database ... 55%\r(Reading    ... 75%\r(Reading database ... 80%\r(Reading
database ... 85%\r(Reading database ... 90%\r(Readirectories currently installed.)\r\
nPreparing to unpack .../systemd-sysv_245.4-4ubuntu3.18_amd64eparing to unpack
.../systemd-timesyncd_245.4-4ubuntu3.18_amd64.deb ...\r\nUnpacking systemd-tim-
systemd_245.4-4ubuntu3.18_amd64.deb ...\r\nUnpacking libpam-systemd:amd64 (245.4-
4ubuntu3.18) ob ...\r\nUnpacking systemd (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17)
...\r\nPreparing to unpa4ubuntu3.18) over (245.4-4ubuntu3.17) ...\r\nSetting up
libsystemd0:amd64 (245.4-4ubuntu3.18) ..g database ... 15%\r(Reading database ...
20%\r(Reading database ... 25%\r(Reading database ... ading database ... 50%\
r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database r(Reading
database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading
databPreparing to unpack .../0-netplan.io_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\
nUnpacking netplan.i-libnetplan0_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\nUnpacking
libnetplan0:amd64 (0.104-0ubuntu2n_2.0.0ubuntu0.20.04.8_all.deb ...\r\nUnpacking
python-apt-common (2.0.0ubuntu0.20.04.8) over (2d64.deb ...\r\nUnpacking python3-apt
(2.0.0ubuntu0.20.04.8) over (2.0.0ubuntu0.20.04.7) ...\r\nPg ubuntu-advantage-tools
(27.10.1~20.04.1) over (27.9~20.04.1) ...\r\nPreparing to unpack .../5-r-core
(1:20.04.39) over (1:20.04.38) ...\r\nPreparing to unpack .../6-python3-
distupgrade_1%3a2\nPreparing to unpack .../7-libtss2-esys0_2.3.2-
1ubuntu0.20.04.1_amd64.deb ...\r\nUnpacking libtbuntu5.6) ...\r\nSetting up libtss2-
esys0 (2.3.2-1ubuntu0.20.04.1) ...\r\nSetting up libnetplan0initramfs: deferring
update (trigger activated)\r\nSetting up python-apt-common (2.0.0ubuntu0.20tupgrade
(1:20.04.39) ...\r\nSetting up ubuntu-release-upgrader-core (1:20.04.39) ...\r\
nSetting) ...\r\nSetting up netplan.io (0.104-0ubuntu2~20.04.2) ...\r\nSetting up
systemd-timesyncd (245ss-systemd:amd64 (245.4-4ubuntu3.18) ...\r\nSetting up libpam-
systemd:amd64 (245.4-4ubuntu3.18) or libc-bin (2.31-0ubuntu9.9) ...\r\nProcessing
triggers for man-db (2.9.1-1) ...\r\nProcessing amfs: deferring update (trigger
activated)\r\nProcessing triggers for dbus (1.12.16-2ubuntu2.2) Generating
/boot/initrd.img-5.4.0-126-generic\r\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "Calculating upgrade...",
                "The following packages will be upgraded:",
                "    base-files libnetplan0 libnss-systemd libpam-systemd
libsystemd0",
                "    libtss2-esys0 libudev1 motd-news-config netplan.io python-apt-
common",
                "    python3-apt python3-distupgrade systemd systemd-sysv systemd-
timesyncd",
                "    ubuntu-advantage-tools ubuntu-release-upgrader-core udev",
                "18 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.",
                "Need to get 6747 kB of archives.",
                "After this operation, 2594 kB disk space will be freed.",
                "Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 motd-news-c
                "Get:2 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 base-files
                "Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libnss-syst
                "Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 udev amd64
                "Get:5 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libudev1 am
                "Get:6 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 systemd-sys
                "Get:7 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 systemd-tim
                "Get:8 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libpam-syst
                "Get:9 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 systemd amd
                "Get:10 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libsystemd
                "Get:11 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 netplan.io
                "Get:12 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libnetplan
                "Get:13 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 python-apt
                "Get:14 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 python3-ap
                "Get:15 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 ubuntu-adv
                "Get:16 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 ubuntu-rel
                "Get:17 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 python3-di
                "Get:18 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libtss2-es
                "Preconfiguring packages ...",
                "Fetched 6747 kB in 1s (6785 kB/s)",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../motd-news-config_11ubuntu5.6_all.deb ...",
                "Unpacking motd-news-config (11ubuntu5.6) over (11ubuntu5.5) ...",
                "Preparing to unpack .../base-files_11ubuntu5.6_amd64.deb ...",
                "Warning: Stopping motd-news.service, but it can still be activated
by:",
                "    motd-news.timer",
                "Unpacking base-files (11ubuntu5.6) over (11ubuntu5.5) ...",
                "Setting up base-files (11ubuntu5.6) ...",
                "Installing new version of config file /etc/issue ...",
                "Installing new version of config file /etc/issue.net ...",
                "Installing new version of config file /etc/lsb-release ...",
                "motd-news.service is a disabled or a static unit, not starting it.",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../libnss-systemd_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking libnss-systemd:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../udev_245.4-4ubuntu3.18_amd64.deb ...",
                "Unpacking udev (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...",
                "Preparing to unpack .../libudev1_245.4-4ubuntu3.18_amd64.deb ...",
                "Unpacking libudev1:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Setting up libudev1:amd64 (245.4-4ubuntu3.18) ...",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../systemd-sysv_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking systemd-sysv (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../systemd-timesyncd_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking systemd-timesyncd (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../libpam-systemd_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking libpam-systemd:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../systemd_245.4-4ubuntu3.18_amd64.deb ...",
                "Unpacking systemd (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...",
                "Preparing to unpack .../libsystemd0_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking libsystemd0:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Setting up libsystemd0:amd64 (245.4-4ubuntu3.18) ...",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../0-netplan.io_0.104-
0ubuntu2~20.04.2_amd64.deb ...",
                "Unpacking netplan.io (0.104-0ubuntu2~20.04.2) over (0.104-
0ubuntu2~20.04.1) ...",
                "Preparing to unpack .../1-libnetplan0_0.104-
0ubuntu2~20.04.2_amd64.deb ...",
                "Unpacking libnetplan0:amd64 (0.104-0ubuntu2~20.04.2) over (0.104-
0ubuntu2~20.04.1) ..."
                "Preparing to unpack .../2-python-apt-
common_2.0.0ubuntu0.20.04.8_all.deb ...",
                "Unpacking python-apt-common (2.0.0ubuntu0.20.04.8) over
(2.0.0ubuntu0.20.04.7) ...",
                "Preparing to unpack .../3-python3-apt_2.0.0ubuntu0.20.04.8_amd64.deb
...",
                "Unpacking python3-apt (2.0.0ubuntu0.20.04.8) over
(2.0.0ubuntu0.20.04.7) ...",
                "Preparing to unpack .../4-ubuntu-advantage-
tools_27.10.1~20.04.1_amd64.deb ...",
                "Unpacking ubuntu-advantage-tools (27.10.1~20.04.1) over
(27.9~20.04.1) ...",
                "Preparing to unpack .../5-ubuntu-release-upgrader-
core_1%3a20.04.39_all.deb ...",
                "Unpacking ubuntu-release-upgrader-core (1:20.04.39) over
(1:20.04.38) ...",
                "Preparing to unpack .../6-python3-
distupgrade_1%3a20.04.39_all.deb ...",
                "Unpacking python3-distupgrade (1:20.04.39) over (1:20.04.38) ...",
                "Preparing to unpack .../7-libtss2-esys0_2.3.2-
1ubuntu0.20.04.1_amd64.deb ...",
                "Unpacking libtss2-esys0 (2.3.2-1ubuntu0.20.04.1) over (2.3.2-
1) ...",
                "Setting up motd-news-config (11ubuntu5.6) ...",
                "Setting up libtss2-esys0 (2.3.2-1ubuntu0.20.04.1) ...",
                "Setting up libnetplan0:amd64 (0.104-0ubuntu2~20.04.2) ...",
                "Setting up udev (245.4-4ubuntu3.18) ...",
                "update-initramfs: deferring update (trigger activated)",
                "Setting up python-apt-common (2.0.0ubuntu0.20.04.8) ...",
                "Setting up python3-apt (2.0.0ubuntu0.20.04.8) ...",
                "Setting up python3-distupgrade (1:20.04.39) ...",
                "Setting up ubuntu-release-upgrader-core (1:20.04.39) ...",
                "Setting up ubuntu-advantage-tools (27.10.1~20.04.1) ...",
                "Setting up systemd (245.4-4ubuntu3.18) ...",
                "Setting up netplan.io (0.104-0ubuntu2~20.04.2) ...",
                "Setting up systemd-timesyncd (245.4-4ubuntu3.18) ...",
                "Setting up systemd-sysv (245.4-4ubuntu3.18) ...",
                "Setting up libnss-systemd:amd64 (245.4-4ubuntu3.18) ...",
                "Setting up libpam-systemd:amd64 (245.4-4ubuntu3.18) ...",
                "Processing triggers for install-info (6.7.0.dfsg.2-5) ...",
                "Processing triggers for libc-bin (2.31-0ubuntu9.9) ...",
                "Processing triggers for man-db (2.9.1-1) ...",
                "Processing triggers for plymouth-theme-ubuntu-text
(0.9.4git20200323-0ubuntu6.2) ...",
                "update-initramfs: deferring update (trigger activated)",
                "Processing triggers for dbus (1.12.16-2ubuntu2.2) ...",
                "Processing triggers for initramfs-tools (0.136ubuntu6.7) ...",
                "update-initramfs: Generating /boot/initrd.img-5.4.0-126-generic"
        ]
}
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo2.yaml
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! conflicting action statements: shell, uid

The error appears to be in '/home/ansadmin/exo3.yaml': line 7, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: utilisateur
            ^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! unexpected parameter type in action: <class 'int'>
The error appears to be in '/home/ansadmin/exo3.yaml': line 7, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: adduser supervision
            ^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! A malformed block was encountered while loading tasks: {'user': [{'name':
'supervision', 'uid': '5000', 'groups': 'rennes'}]} should be a list or None but is
<class 'ansible.parsing.y aml.objects.AnsibleMapping'>

The error appears to be in '/home/ansadmin/exo3.yaml': line 2, column 3, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: creation d'utilisateur
    ^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml

PLAY [creation d'utilisateur]


*****************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creer user]


*****************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ ansible -bm shell -a "id supervision"


usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT]
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: the following arguments are required: pattern
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible -bm shell -a "cat /etc/passwd | grep super"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT]
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: the following arguments are required: pattern
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible -b -m shell -a "cat /etc/passwd | grep super"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT]
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: the following arguments are required: pattern
ansadmin@svl200:~$ ansible all -b -m shell -a "cat /etc/passwd | grep super"
146.59.158.16 | CHANGED | rc=0 >>
supervision:x:5000:5000::/home/supervision:/bin/sh
141.95.160.133 | CHANGED | rc=0 >>
supervision:x:5000:5000::/home/supervision:/bin/sh
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ cd /etc/ap
apache2/        apparmor/      apparmor.d/ apport/          apt/
ansadmin@svl200:~$
---
- name: Deployer apache
    hosts: cible1
    become: true

    tasks:
        - name: deploiement

Network error: Software caused connection abort


~
─────────────────────────────────────────────────────────────────────────────────────
──────────
~
Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
-- INSERT --                                                                         
8,7                      All

Network error: Connection timed out

─────────────────────────────────────────────────────────────────────────────────────
──────────
Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Last login: Tue Oct    4 07:50:40 2022 from 176.160.191.208


ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml
ERROR! conflicting action statements: apt, state

The error appears to be in '/home/ansadmin/exo4.yaml': line 7, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: deploiement
            ^ here
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml

PLAY [Deployer apache]


************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]

TASK [deploiement]
****************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'apache' is a vailable"}

PLAY RECAP
************************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml

PLAY [Deployer apache]


************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [deploiement]
****************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'apache' is a vailable"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "No package matching
'apache' is available"}

PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim exo4.yaml


ansadmin@svl200:~$ ansible-playbook exo4.yaml

PLAY [Deployer apache]


************************************************************************

TASK [Gathering Facts]


************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [deploiement]
****************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]
PLAY RECAP
************************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0        res cued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0        res cued=0        ignored=0

ansadmin@svl200:~$ sudo vim exo4.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$ ansible-playbook when1.yaml

PLAY [exemple avec condition when]


****************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


********************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [install apache2 on ubuntu]


******************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim when1.yaml


ansadmin@svl200:~$ sudo vim rep.yaml
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation]
***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation]
***********************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  1      rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim rep.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc"
146.59.158.16 | CHANGED | rc=0 >>
total 884
-rw-r--r-- 1 root root                887 Apr    1    2013 rpc
-rw-r--r-- 1 root root              2932 Apr    1    2013 protocols
-rw-r--r-- 1 root root                280 Jun 20    2014 fuse.conf
-rw-r--r-- 1 root root              3663 Jun 20    2016 screenrc
-rw-r--r-- 1 root root                604 Sep 15    2018 deluser.conf
-rw-r----- 1 root daemon            144 Nov 12    2018 at.deny
-rw-r--r-- 1 root root              1260 Dec 14    2018 ucf.conf
-rw-r--r-- 1 root root                533 Jan 21    2019 logrotate.conf
-rw-r--r-- 1 root root            14867 Feb    1    2019 ltrace.conf
-rw-r--r-- 1 root root              2969 Aug    3    2019 debconf.conf
-rw-r--r-- 1 root root              5060 Aug 21    2019 hdparm.conf
-rw-r--r-- 1 root root                642 Sep 24    2019 xattr.conf
-rw-r--r-- 1 root root            24546 Oct 18    2019 mime.types
-rw-r--r-- 1 root root                449 Oct 18    2019 mailcap.order
-rw-r--r-- 1 root root                581 Dec    5    2019 profile
-rw-r--r-- 1 root root                  91 Dec    5    2019 networks
-rw-r--r-- 1 root root                267 Dec    5    2019 legal
-rw-r--r-- 1 root root                  92 Dec    5    2019 host.conf
-rw-r--r-- 1 root root                  13 Dec    5    2019 debian_version
-rw-r--r-- 1 root root                552 Dec 17    2019 pam.conf
-rw-r--r-- 1 root root              1816 Dec 27    2019 ethertypes
-rw-r--r-- 1 root root                111 Jan 16    2020 magic.mime
-rw-r--r-- 1 root root                111 Jan 16    2020 magic
-rw-r--r-- 1 root root                  45 Jan 26    2020 bash_completion
-rw-r--r-- 1 root root              2584 Feb    1    2020 gai.conf
-r--r----- 1 root root                755 Feb    3    2020 sudoers
-rw-r--r-- 1 root root            10037 Feb    7    2020 nanorc
-rw-r--r-- 1 root root            10550 Feb    7    2020 login.defs
-rw-r--r-- 1 root root              1523 Feb 10    2020 usb_modeswitch.conf
-rw-r--r-- 1 root root              1382 Feb 11    2020 rsyslog.conf
-rw-r--r-- 1 root root              1042 Feb 13    2020 crontab
-rw-r--r-- 1 root root              2351 Feb 13    2020 sysctl.conf
-rw-r--r-- 1 root root                808 Feb 14    2020 mke2fs.conf
-rw-r--r-- 1 root root                685 Feb 14    2020 e2scrub.conf
-rw-r--r-- 1 root root            14464 Feb 16    2020 services
-rw-r--r-- 1 root root                191 Feb 18    2020 libaudit.conf
drwxr-xr-x 2 root root              4096 Feb 24    2020 usb_modeswitch.d
-rw-r--r-- 1 root root              1748 Feb 25    2020 inputrc
-rw-r--r-- 1 root root              2319 Feb 25    2020 bash.bashrc
-rw-r--r-- 1 root root              5215 Feb 25    2020 manpath.config
-rw-r--r-- 1 root root                  41 Apr    6    2020 multipath.conf
-rw-r--r-- 1 root root              2996 Apr 14    2020 locale.alias
-rw-r--r-- 1 root root                  34 Apr 14    2020 ld.so.conf
-rw-r--r-- 1 root root                367 Apr 14    2020 bindresvport.blacklist
drwxr-xr-x 2 root root              4096 Apr 22    2020 binfmt.d
-rw-r--r-- 1 root root              6920 Nov    2    2021 overlayroot.conf
-rw-r--r-- 1 root root              4942 Nov 12    2021 wgetrc
-rw-r--r-- 1 root root                477 Feb 10    2022 zsh_command_not_found
drwxrwxr-x 2 root landscape    4096 Feb 14    2022 landscape
lrwxrwxrwx 1 root root                  13 Mar 15    2022 rmt -> /usr/sbin/rmt
-rw-r--r-- 1 root root            10593 Mar 31    2022 sensors3.conf
drwxr-xr-x 2 root root              4096 Apr 25 14:02 update-notifier
drwxr-xr-x 2 root root              4096 Jul 24 21:38 opt
drwxr-xr-x 2 root root              4096 Jul 24 21:38 selinux
drwxr-xr-x 2 root root              4096 Jul 24 21:38 terminfo
-rw-r--r-- 1 root root              3028 Jul 24 21:38 adduser.conf
lrwxrwxrwx 1 root root                  39 Jul 24 21:38 resolv.conf ->
../run/systemd/resolve/st                  ub-resolv.conf
lrwxrwxrwx 1 root root                  19 Jul 24 21:38 mtab -> ../proc/self/mounts
drwxr-xr-x 7 root root              4096 Jul 24 21:38 apt
drwxr-xr-x 3 root root              4096 Jul 24 21:38 ca-certificates
drwxr-xr-x 4 root root              4096 Jul 24 21:38 dbus-1
drwxr-xr-x 8 root root              4096 Jul 24 21:38 networkd-dispatcher
drwxr-xr-x 4 root root              4096 Jul 24 21:38 xdg
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.hourly
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.monthly
-rw-r--r-- 1 root root                510 Jul 24 21:38 nsswitch.conf
-rw-r--r-- 1 root root                195 Jul 24 21:38 modules
drwxr-xr-x 2 root root              4096 Jul 24 21:38 newt
drwxr-xr-x 4 root root              4096 Jul 24 21:38 iproute2
-rw-r--r-- 1 root root              5713 Jul 24 21:38 ca-certificates.conf.dpkg-old
drwxr-xr-x 2 root root              4096 Jul 24 21:38 python3
lrwxrwxrwx 1 root root                  23 Jul 24 21:38 vtrgb ->
/etc/alternatives/vtrgb
drwxr-xr-x 2 root root              4096 Jul 24 21:38 skel
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dpkg
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ld.so.conf.d
drwxr-xr-x 4 root root              4096 Jul 24 21:39 security
-rw-r--r-- 1 root root                106 Jul 24 21:39 environment
drwxr-xr-x 4 root root              4096 Jul 24 21:39 ssl
drwxr-xr-x 2 root root              4096 Jul 24 21:39 python3.8
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dhcp
drwxr-xr-x 2 root root              4096 Jul 24 21:39 depmod.d
-rw-r--r-- 1 root root              6821 Jul 24 21:39 ca-certificates.conf
-rw-r--r-- 1 root root                110 Jul 24 21:39 kernel-img.conf
drwxr-xr-x 3 root root              4096 Jul 24 21:39 perl
drwxr-xr-x 3 root root              4096 Jul 24 21:39 gss
-rw-r--r-- 1 root root                  54 Jul 24 21:39 crypttab
drwxr-xr-x 5 root root              4096 Jul 24 21:39 kernel
drwxr-xr-x 3 root root              4096 Jul 24 21:39 dconf
drwxr-xr-x 4 root root              4096 Jul 24 21:39 network
drwxr-xr-x 4 root root              4096 Jul 24 21:39 pki
drwxr-xr-x 3 root root              4096 Jul 24 21:39 pm
drwxr-xr-x 3 root root              4096 Jul 24 21:39 libblockdev
drwxr-xr-x 4 root root              4096 Jul 24 21:39 polkit-1
drwxr-xr-x 3 root root              4096 Jul 24 21:39 ModemManager
drwxr-xr-x 3 root root              4096 Jul 24 21:39 NetworkManager
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ldap
drwxr-xr-x 3 root root              4096 Jul 24 21:39 apparmor
-rw-r--r-- 1 root root                711 Jul 24 21:39 hosts.deny
-rw-r--r-- 1 root root                411 Jul 24 21:39 hosts.allow
drwxr-xr-x 2 root root              4096 Jul 24 21:39 calendar
drwxr-xr-x 2 root root              4096 Jul 24 21:39 modprobe.d
drwxr-xr-x 2 root root              4096 Jul 24 21:39 mdadm
drwxr-xr-x 2 root root              4096 Jul 24 21:39 byobu
drwxr-xr-x 2 root root              4096 Jul 24 21:39 tmpfiles.d
-rw-r--r-- 1 root root                146 Jul 24 21:39 shells
drwxr-xr-x 2 root root              4096 Jul 24 21:39 iscsi
drwxr-xr-x 2 root root              4096 Jul 24 21:40 groff
drwxr-xr-x 5 root root              4096 Jul 24 21:40 initramfs-tools
drwxr-xr-x 2 root root              4096 Jul 24 21:40 rsyslog.d
drwxr-xr-x 3 root root              4096 Jul 24 21:40 ufw
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cryptsetup-initramfs
drwxr-xr-x 2 root root              4096 Jul 24 21:40 udisks2
drwxr-xr-x 3 root root              4096 Jul 24 21:40 apport
drwxr-xr-x 2 root root              4096 Jul 24 21:40 bash_completion.d
drwxr-xr-x 2 root root              4096 Jul 24 21:40 pollinate
drwxr-xr-x 3 root root              4096 Jul 24 21:40 fwupd
drwxr-xr-x 3 root root              4096 Jul 24 21:40 lvm
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cron.weekly
drwxr-xr-x 2 root root              4096 Jul 24 21:40 PackageKit
-rw-r--r-- 1 root root                  33 Jul 24 21:40 ec2_version
drwxr-xr-x 2 root root              4096 Jul 24 21:40 console-setup
-rw-r--r-- 1 root root                    0 Jul 24 21:40 popularity-contest.conf
-rw-r--r-- 1 root root              9440 Jul 24 21:40 locale.gen
-rw-r--r-- 1 root root                112 Jul 24 21:40 overlayroot.local.conf
-rw-r--r-- 1 root root                  84 Jul 24 21:41 fstab
drwxr-xr-x 2 root root              4096 Jul 24 21:41 grub.d
drwxr-xr-x 2 root root              4096 Aug    1 05:31 netplan
drwxr-xr-x 3 root root              4096 Aug    1 05:32 qemu
drwxr-xr-x 4 root root              4096 Aug    1 05:32 cloud
-rw-r--r-- 1 root root                104 Aug 22 10:53 lsb-release
lrwxrwxrwx 1 root root                  21 Aug 22 10:54 os-release -> ../usr/lib/os-
release
-rw-r--r-- 1 root root                  19 Aug 22 10:54 issue.net
-rw-r--r-- 1 root root                  26 Aug 22 10:54 issue
drwx------ 2 root root              4096 Aug 26 08:20 multipath
-r--r--r-- 1 root root                  33 Aug 26 08:20 machine-id
drwxr-xr-x 4 root root              4096 Aug 27 06:07 vmware-tools
-rw-r--r-- 1 root root                    8 Sep    8 06:16 timezone
lrwxrwxrwx 1 root root                  27 Sep    8 06:16 localtime ->
/usr/share/zoneinfo/Etc/UTC
drwxr-xr-x 5 root root              4096 Sep 19 09:45 vulkan
drwxr-xr-x 7 root root              4096 Sep 19 09:46 X11
drwxr-xr-x 2 root root              4096 Sep 19 09:46 rcS.d
drwxr-xr-x 2 root root              4096 Sep 19 09:46 sensors.d
drwxr-xr-x 4 root root              4096 Sep 19 09:46 fonts
drwxr-xr-x 2 root root              4096 Sep 19 09:46 environment.d
drwxr-xr-x 5 root root              4096 Sep 19 09:46 java-11-openjdk
-rw-r--r-- 1 root root                  15 Sep 20 05:01 hostname
drwxr-xr-x 2 root root              4096 Sep 20 06:40 vim
-rw-r--r-- 1 root root              3956 Sep 20 06:40 mailcap
-rw-r--r-- 1 root root                363 Sep 21 08:44 hosts
drwxr-xr-x 8 root root              4096 Sep 22 15:42 apache2
drwxr-xr-x 2 root root              4096 Sep 22 15:42 cron.daily
drwxr-xr-x 2 root root              4096 Sep 23 09:32 wildfly
drwxr-xr-x 2 root root              4096 Sep 25 18:18 process-exporter
drwxr-xr-x 6 root root              4096 Sep 28 06:24 sos
drwxr-xr-x 2 root root              4096 Oct    2 17:35 profile.d
drwxr-xr-x 2 root root              4096 Oct    2 17:35 sysctl.d
drwxr-xr-x 2 root root              4096 Oct    2 17:35 modules-load.d
drwxr-xr-x 4 root root              4096 Oct    2 17:35 udev
drwxr-xr-x 3 root root              4096 Oct    2 17:35 update-manager
drwxr-xr-x 2 root root              4096 Oct    2 17:35 ubuntu-advantage
drwxr-xr-x 2 root root              4096 Oct    2 17:35 update-motd.d
drwxr-xr-x 5 root root              4096 Oct    2 17:36 systemd
drwxr-xr-x 2 root root              4096 Oct    2 17:36 pam.d
drwxr-x--- 2 root root              4096 Oct    3 08:54 sudoers.d
drwxr-xr-x 4 root root              4096 Oct    3 08:56 ssh
drwxr-xr-x 8 root root              4096 Oct    3 12:32 nginx
-rw-r--r-- 1 root root                178 Oct    4 07:58 subuid-
-rw-r--r-- 1 root root                178 Oct    4 07:58 subgid-
-rw-r----- 1 root shadow            944 Oct    4 08:45 gshadow-
-rw-r--r-- 1 root root              1136 Oct    4 08:45 group-
-rw-r--r-- 1 root root                203 Oct    4 08:45 subuid
-rw-r--r-- 1 root root                203 Oct    4 08:45 subgid
-rw-r----- 1 root shadow          1907 Oct    4 08:59 shadow-
-rw-r--r-- 1 root root              2362 Oct    4 08:59 passwd-
-rw-r--r-- 1 root root              1149 Oct    4 08:59 group
-rw-r----- 1 root shadow            954 Oct    4 08:59 gshadow
-rw-r----- 1 root shadow          1907 Oct    4 08:59 shadow
-rw-r--r-- 1 root root              2377 Oct    4 08:59 passwd
drwxr-xr-x 6 root root              4096 Oct    4 08:59 logcheck
drwxr-xr-x 3 root root              4096 Oct    4 08:59 php
drwxr-xr-x 2 root root              4096 Oct    4 08:59 cron.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 alternatives
drwxr-xr-x 7 root root              4096 Oct    4 08:59 apparmor.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 insserv.conf.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 init.d
drwxr-xr-x 3 root root              4096 Oct    4 08:59 default
drwxr-xr-x 2 root root              4096 Oct    4 08:59 logrotate.d
drwxr-xr-x 4 root root              4096 Oct    4 08:59 mysql
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc6.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc5.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc4.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc3.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc2.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc1.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc0.d
-rw-r--r-- 1 root root            31764 Oct    4 08:59 ld.so.cache
141.95.160.133 | CHANGED | rc=0 >>
total 884
-rw-r--r-- 1 root root                887 Apr    1    2013 rpc
-rw-r--r-- 1 root root              2932 Apr    1    2013 protocols
-rw-r--r-- 1 root root                280 Jun 20    2014 fuse.conf
-rw-r--r-- 1 root root              3663 Jun 20    2016 screenrc
-rw-r--r-- 1 root root                604 Sep 15    2018 deluser.conf
-rw-r----- 1 root daemon            144 Nov 12    2018 at.deny
-rw-r--r-- 1 root root              1260 Dec 14    2018 ucf.conf
-rw-r--r-- 1 root root                533 Jan 21    2019 logrotate.conf
-rw-r--r-- 1 root root            14867 Feb    1    2019 ltrace.conf
-rw-r--r-- 1 root root              2969 Aug    3    2019 debconf.conf
-rw-r--r-- 1 root root              5060 Aug 21    2019 hdparm.conf
-rw-r--r-- 1 root root                642 Sep 24    2019 xattr.conf
-rw-r--r-- 1 root root            24546 Oct 18    2019 mime.types
-rw-r--r-- 1 root root                449 Oct 18    2019 mailcap.order
-rw-r--r-- 1 root root                581 Dec    5    2019 profile
-rw-r--r-- 1 root root                  91 Dec    5    2019 networks
-rw-r--r-- 1 root root                267 Dec    5    2019 legal
-rw-r--r-- 1 root root                  92 Dec    5    2019 host.conf
-rw-r--r-- 1 root root                  13 Dec    5    2019 debian_version
-rw-r--r-- 1 root root                552 Dec 17    2019 pam.conf
-rw-r--r-- 1 root root              1816 Dec 27    2019 ethertypes
-rw-r--r-- 1 root root                111 Jan 16    2020 magic.mime
-rw-r--r-- 1 root root                111 Jan 16    2020 magic
-rw-r--r-- 1 root root                  45 Jan 26    2020 bash_completion
-rw-r--r-- 1 root root              2584 Feb    1    2020 gai.conf
-r--r----- 1 root root                755 Feb    3    2020 sudoers
-rw-r--r-- 1 root root            10037 Feb    7    2020 nanorc
-rw-r--r-- 1 root root            10550 Feb    7    2020 login.defs
-rw-r--r-- 1 root root              1523 Feb 10    2020 usb_modeswitch.conf
-rw-r--r-- 1 root root              1382 Feb 11    2020 rsyslog.conf
-rw-r--r-- 1 root root              1042 Feb 13    2020 crontab
-rw-r--r-- 1 root root              2351 Feb 13    2020 sysctl.conf
-rw-r--r-- 1 root root                808 Feb 14    2020 mke2fs.conf
-rw-r--r-- 1 root root                685 Feb 14    2020 e2scrub.conf
-rw-r--r-- 1 root root            14464 Feb 16    2020 services
-rw-r--r-- 1 root root                191 Feb 18    2020 libaudit.conf
drwxr-xr-x 2 root root              4096 Feb 24    2020 usb_modeswitch.d
-rw-r--r-- 1 root root              1748 Feb 25    2020 inputrc
-rw-r--r-- 1 root root              2319 Feb 25    2020 bash.bashrc
-rw-r--r-- 1 root root              5215 Feb 25    2020 manpath.config
-rw-r--r-- 1 root root                  41 Apr    6    2020 multipath.conf
-rw-r--r-- 1 root root              2996 Apr 14    2020 locale.alias
-rw-r--r-- 1 root root                  34 Apr 14    2020 ld.so.conf
-rw-r--r-- 1 root root                367 Apr 14    2020 bindresvport.blacklist
drwxr-xr-x 2 root root              4096 Apr 22    2020 binfmt.d
-rw-r--r-- 1 root root              6920 Nov    2    2021 overlayroot.conf
-rw-r--r-- 1 root root              4942 Nov 12    2021 wgetrc
-rw-r--r-- 1 root root                477 Feb 10    2022 zsh_command_not_found
drwxrwxr-x 2 root landscape    4096 Feb 14    2022 landscape
lrwxrwxrwx 1 root root                  13 Mar 15    2022 rmt -> /usr/sbin/rmt
-rw-r--r-- 1 root root            10593 Mar 31    2022 sensors3.conf
drwxr-xr-x 2 root root              4096 Apr 25 14:02 update-notifier
drwxr-xr-x 2 root root              4096 Jul 24 21:38 opt
drwxr-xr-x 2 root root              4096 Jul 24 21:38 selinux
drwxr-xr-x 2 root root              4096 Jul 24 21:38 terminfo
-rw-r--r-- 1 root root              3028 Jul 24 21:38 adduser.conf
lrwxrwxrwx 1 root root                  39 Jul 24 21:38 resolv.conf ->
../run/systemd/resolve/st                  ub-resolv.conf
lrwxrwxrwx 1 root root                  19 Jul 24 21:38 mtab -> ../proc/self/mounts
drwxr-xr-x 7 root root              4096 Jul 24 21:38 apt
drwxr-xr-x 3 root root              4096 Jul 24 21:38 ca-certificates
drwxr-xr-x 4 root root              4096 Jul 24 21:38 dbus-1
drwxr-xr-x 8 root root              4096 Jul 24 21:38 networkd-dispatcher
drwxr-xr-x 4 root root              4096 Jul 24 21:38 xdg
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.hourly
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.monthly
-rw-r--r-- 1 root root                510 Jul 24 21:38 nsswitch.conf
-rw-r--r-- 1 root root                195 Jul 24 21:38 modules
drwxr-xr-x 2 root root              4096 Jul 24 21:38 newt
drwxr-xr-x 4 root root              4096 Jul 24 21:38 iproute2
-rw-r--r-- 1 root root              5713 Jul 24 21:38 ca-certificates.conf.dpkg-old
drwxr-xr-x 2 root root              4096 Jul 24 21:38 python3
lrwxrwxrwx 1 root root                  23 Jul 24 21:38 vtrgb ->
/etc/alternatives/vtrgb
drwxr-xr-x 2 root root              4096 Jul 24 21:38 skel
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dpkg
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ld.so.conf.d
drwxr-xr-x 4 root root              4096 Jul 24 21:39 security
-rw-r--r-- 1 root root                106 Jul 24 21:39 environment
drwxr-xr-x 4 root root              4096 Jul 24 21:39 ssl
drwxr-xr-x 2 root root              4096 Jul 24 21:39 python3.8
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dhcp
drwxr-xr-x 2 root root              4096 Jul 24 21:39 depmod.d
-rw-r--r-- 1 root root              6821 Jul 24 21:39 ca-certificates.conf
-rw-r--r-- 1 root root                110 Jul 24 21:39 kernel-img.conf
drwxr-xr-x 3 root root              4096 Jul 24 21:39 perl
drwxr-xr-x 3 root root              4096 Jul 24 21:39 gss
-rw-r--r-- 1 root root                  54 Jul 24 21:39 crypttab
drwxr-xr-x 5 root root              4096 Jul 24 21:39 kernel
drwxr-xr-x 3 root root              4096 Jul 24 21:39 dconf
drwxr-xr-x 4 root root              4096 Jul 24 21:39 network
drwxr-xr-x 4 root root              4096 Jul 24 21:39 pki
drwxr-xr-x 3 root root              4096 Jul 24 21:39 pm
drwxr-xr-x 3 root root              4096 Jul 24 21:39 libblockdev
drwxr-xr-x 4 root root              4096 Jul 24 21:39 polkit-1
drwxr-xr-x 3 root root              4096 Jul 24 21:39 ModemManager
drwxr-xr-x 3 root root              4096 Jul 24 21:39 NetworkManager
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ldap
drwxr-xr-x 3 root root              4096 Jul 24 21:39 apparmor
-rw-r--r-- 1 root root                711 Jul 24 21:39 hosts.deny
-rw-r--r-- 1 root root                411 Jul 24 21:39 hosts.allow
drwxr-xr-x 2 root root              4096 Jul 24 21:39 calendar
drwxr-xr-x 2 root root              4096 Jul 24 21:39 modprobe.d
drwxr-xr-x 2 root root              4096 Jul 24 21:39 mdadm
drwxr-xr-x 2 root root              4096 Jul 24 21:39 byobu
drwxr-xr-x 2 root root              4096 Jul 24 21:39 tmpfiles.d
-rw-r--r-- 1 root root                146 Jul 24 21:39 shells
drwxr-xr-x 2 root root              4096 Jul 24 21:39 iscsi
drwxr-xr-x 2 root root              4096 Jul 24 21:40 groff
drwxr-xr-x 5 root root              4096 Jul 24 21:40 initramfs-tools
drwxr-xr-x 2 root root              4096 Jul 24 21:40 rsyslog.d
drwxr-xr-x 3 root root              4096 Jul 24 21:40 ufw
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cryptsetup-initramfs
drwxr-xr-x 2 root root              4096 Jul 24 21:40 udisks2
drwxr-xr-x 3 root root              4096 Jul 24 21:40 apport
drwxr-xr-x 2 root root              4096 Jul 24 21:40 bash_completion.d
drwxr-xr-x 2 root root              4096 Jul 24 21:40 pollinate
drwxr-xr-x 3 root root              4096 Jul 24 21:40 fwupd
drwxr-xr-x 3 root root              4096 Jul 24 21:40 lvm
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cron.weekly
drwxr-xr-x 2 root root              4096 Jul 24 21:40 PackageKit
-rw-r--r-- 1 root root                  33 Jul 24 21:40 ec2_version
drwxr-xr-x 2 root root              4096 Jul 24 21:40 console-setup
-rw-r--r-- 1 root root                    0 Jul 24 21:40 popularity-contest.conf
-rw-r--r-- 1 root root              9440 Jul 24 21:40 locale.gen
-rw-r--r-- 1 root root                112 Jul 24 21:40 overlayroot.local.conf
-rw-r--r-- 1 root root                  84 Jul 24 21:41 fstab
drwxr-xr-x 2 root root              4096 Jul 24 21:41 grub.d
drwxr-xr-x 2 root root              4096 Aug    1 05:31 netplan
drwxr-xr-x 3 root root              4096 Aug    1 05:32 qemu
drwxr-xr-x 4 root root              4096 Aug    1 05:32 cloud
-rw-r--r-- 1 root root                104 Aug 22 10:53 lsb-release
lrwxrwxrwx 1 root root                  21 Aug 22 10:54 os-release -> ../usr/lib/os-
release
-rw-r--r-- 1 root root                  19 Aug 22 10:54 issue.net
-rw-r--r-- 1 root root                  26 Aug 22 10:54 issue
drwx------ 2 root root              4096 Sep 14 10:23 multipath
-r--r--r-- 1 root root                  33 Sep 14 10:23 machine-id
-rw-r--r-- 1 root root                271 Sep 14 10:23 hosts
-rw-r--r-- 1 root root                    8 Sep 14 10:30 timezone
lrwxrwxrwx 1 root root                  27 Sep 14 10:30 localtime ->
/usr/share/zoneinfo/Etc/UTC
drwxr-xr-x 4 root root              4096 Sep 14 10:30 vmware-tools
drwxr-xr-x 4 root root              4096 Sep 14 13:28 ssh
drwxr-xr-x 2 root root              4096 Sep 20 06:33 vim
-rw-r--r-- 1 root root                  15 Sep 20 07:01 hostname
drwxr-xr-x 5 root root              4096 Sep 20 07:02 vulkan
drwxr-xr-x 7 root root              4096 Sep 20 07:02 X11
drwxr-xr-x 2 root root              4096 Sep 20 07:02 rcS.d
drwxr-xr-x 2 root root              4096 Sep 20 07:02 sensors.d
drwxr-xr-x 4 root root              4096 Sep 20 07:02 fonts
drwxr-xr-x 2 root root              4096 Sep 20 07:02 environment.d
drwxr-xr-x 5 root root              4096 Sep 20 07:02 java-11-openjdk
-rw-r--r-- 1 root root              3891 Sep 20 07:02 mailcap
drwxr-xr-x 2 root root              4096 Sep 24 19:46 process-exporter
drwxr-xr-x 2 root root              4096 Sep 25 11:29 wildfly
drwxr-xr-x 6 root root              4096 Sep 27 06:06 sos
drwxr-x--- 2 root root              4096 Oct    3 08:58 sudoers.d
drwxr-xr-x 8 root root              4096 Oct    3 12:32 nginx
drwxr-xr-x 8 root root              4096 Oct    3 15:25 apache2
drwxr-xr-x 2 root root              4096 Oct    3 15:25 cron.daily
-rw-r--r-- 1 root root                  98 Oct    4 07:58 subuid-
-rw-r--r-- 1 root root                  98 Oct    4 07:58 subgid-
drwxr-xr-x 2 root root              4096 Oct    4 08:24 profile.d
drwxr-xr-x 2 root root              4096 Oct    4 08:24 sysctl.d
drwxr-xr-x 2 root root              4096 Oct    4 08:24 modules-load.d
drwxr-xr-x 4 root root              4096 Oct    4 08:24 udev
drwxr-xr-x 3 root root              4096 Oct    4 08:24 update-manager
drwxr-xr-x 2 root root              4096 Oct    4 08:24 ubuntu-advantage
drwxr-xr-x 2 root root              4096 Oct    4 08:24 update-motd.d
drwxr-xr-x 5 root root              4096 Oct    4 08:24 systemd
drwxr-xr-x 2 root root              4096 Oct    4 08:24 pam.d
-rw-r----- 1 root shadow            875 Oct    4 08:45 gshadow-
-rw-r--r-- 1 root root              1048 Oct    4 08:45 group-
-rw-r--r-- 1 root root                123 Oct    4 08:45 subuid
-rw-r--r-- 1 root root                123 Oct    4 08:45 subgid
-rw-r----- 1 root shadow          1560 Oct    4 08:59 shadow-
-rw-r--r-- 1 root root              2130 Oct    4 08:59 passwd-
-rw-r--r-- 1 root root              1061 Oct    4 08:59 group
-rw-r----- 1 root shadow            885 Oct    4 08:59 gshadow
-rw-r----- 1 root shadow          1560 Oct    4 08:59 shadow
-rw-r--r-- 1 root root              2145 Oct    4 08:59 passwd
drwxr-xr-x 6 root root              4096 Oct    4 08:59 logcheck
drwxr-xr-x 3 root root              4096 Oct    4 08:59 php
drwxr-xr-x 2 root root              4096 Oct    4 08:59 cron.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 alternatives
drwxr-xr-x 7 root root              4096 Oct    4 08:59 apparmor.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 insserv.conf.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 init.d
drwxr-xr-x 3 root root              4096 Oct    4 08:59 default
drwxr-xr-x 2 root root              4096 Oct    4 08:59 logrotate.d
drwxr-xr-x 4 root root              4096 Oct    4 08:59 mysql
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc6.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc5.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc4.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc3.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc2.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc1.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc0.d
-rw-r--r-- 1 root root            31764 Oct    4 08:59 ld.so.cache
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp"
146.59.158.16 | CHANGED | rc=0 >>
total 48
drwx------ 3 root          root          4096 Aug 26 08:20 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-systemd-logind.service-68Kuej
drwx------ 3 root          root          4096 Aug 26 08:20 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-ModemManager.service-cIU2Ef
drwx------ 3 root          root          4096 Aug 26 08:20 snap.lxd
drwx------ 3 root          root          4096 Aug 31 21:07 snap.tree
drwxr-xr-x 2 root          root          4096 Sep 21 10:05 hsperfdata_root
drwxr-xr-x 2 wildfly    wildfly    4096 Sep 25 13:32 hsperfdata_wildfly
drwxr-xr-x 2 apx03        apx03        4096 Sep 26 09:17 hsperfdata_apx03
drwx------ 3 root          root          4096 Oct    2 17:36 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-systemd-resolved.service-xYNRni
drwx------ 3 root          root          4096 Oct    2 17:36 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-systemd-timesyncd.service-fMKZlf
-rwxrwxrwx 1 ansadmin ansadmin        0 Oct    3 10:15 cible1.txt
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
drwxr-xr-x 2 ansadmin ansadmin 4096 Oct    4 08:20 dir
drwxr-xr-x 2 root          root          4096 Oct    4 09:43 Debian
drwx------ 2 root          root          4096 Oct    4 09:45
ansible_command_payload_eh82ie9y
141.95.160.133 | CHANGED | rc=0 >>
total 44
drwx------ 3 root          root          4096 Sep 14 10:23 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-systemd-logind.service-pnYtUi
drwx------ 3 root          root          4096 Sep 14 10:23 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-ModemManager.service-1Rmclg
drwx------ 3 root          root          4096 Sep 14 10:23 snap.lxd
drwxr-xr-x 2 root          root          4096 Sep 21 09:23 hsperfdata_root
drwxr-xr-x 2 etl03        etl03        4096 Sep 21 10:24 hsperfdata_etl03
drwxr-xr-x 2 wildfly    wildfly    4096 Sep 25 15:04 hsperfdata_wildfly
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
drwxr-xr-x 2 ansadmin ansadmin 4096 Oct    4 08:20 dir
drwx------ 3 root          root          4096 Oct    4 08:24 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-systemd-resolved.service-dSPAvh
drwx------ 3 root          root          4096 Oct    4 08:24 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-systemd-timesyncd.service-XoIIlf
drwxr-xr-x 2 root          root          4096 Oct    4 09:43 Debian
drwx------ 2 root          root          4096 Oct    4 09:45
ansible_command_payload_rz12wo4b
ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
──

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Tue Oct    4 08:53:18 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc | grep Deb"
146.59.158.16 | FAILED | rc=1 >>
non-zero return code
141.95.160.133 | FAILED | rc=1 >>
non-zero return code
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation]
***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation]
***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0

ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc | grep Deb"
146.59.158.16 | FAILED | rc=1 >>
non-zero return code
141.95.160.133 | FAILED | rc=1 >>
non-zero return code
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc | grep redhat"
146.59.158.16 | FAILED | rc=1 >>
non-zero return code
141.95.160.133 | FAILED | rc=1 >>
non-zero return code
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation]
***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation]
***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  1      rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim rep.yaml
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation repertoire]


************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation repertoire]


************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation fichier]


***************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation fichier]


***************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=3      changed=1      unreachable=0   
failed=0        skipped=                  2      rescued=0        ignored=0
146.59.158.16                            : ok=3      changed=1      unreachable=0 
failed=0        skipped=                  2      rescued=0        ignored=0

ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/redhat | grep redhat"
146.59.158.16 | FAILED | rc=1 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=1 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/redhat"
146.59.158.16 | FAILED | rc=2 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=2 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/Redhat"
146.59.158.16 | FAILED | rc=2 >>
ls: cannot access '/tmp/Redhat': No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=2 >>
ls: cannot access '/tmp/Redhat': No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/Debian"
146.59.158.16 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
141.95.160.133 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/Debian"
146.59.158.16 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
141.95.160.133 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook list.yaml

PLAY [exemple ansible list]


***********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install package]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim list.yaml
ansadmin@svl200:~$ sudo vim list.yaml
ansadmin@svl200:~$ ansible-playbook list.yaml

PLAY [exemple ansible list]


***********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install package]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ ansible-playbook items.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*************************************************
changed: [146.59.158.16] => (item=init1.txt)
changed: [141.95.160.133] => (item=init1.txt)
changed: [146.59.158.16] => (item=init2.txt)
changed: [141.95.160.133] => (item=init2.txt)
changed: [146.59.158.16] => (item=init3.txt)
changed: [141.95.160.133] => (item=init3.txt)
changed: [146.59.158.16] => (item=init4.txt)
changed: [141.95.160.133] => (item=init4.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ ansible-playbook items.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*************************************************
changed: [146.59.158.16] => (item=init1.txt)
changed: [141.95.160.133] => (item=init1.txt)
changed: [146.59.158.16] => (item=init2.txt)
changed: [141.95.160.133] => (item=init2.txt)
changed: [146.59.158.16] => (item=init3.txt)
changed: [141.95.160.133] => (item=init3.txt)
changed: [146.59.158.16] => (item=init4.txt)
changed: [141.95.160.133] => (item=init4.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep init"
146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
ansadmin@svl200:~$ sudo vim items_users.yaml
ansadmin@svl200:~$ sudo -f items_users.yaml
sudo: invalid option -- 'f'
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
                        [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
                        [-T timeout] [-u user] file ...
ansadmin@svl200:~$
ansadmin@svl200:~$ rm items_users.yaml
rm: remove write-protected regular empty file 'items_users.yaml'?
ansadmin@svl200:~$
ansadmin@svl200:~$ cp items.yaml item_users.yaml
ansadmin@svl200:~$ sudo vim items_users.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo3.yaml      handler.yaml          items.yaml               
rep.yaml              when.yaml
debug.yaml      exo4.yaml      index.html              items_users.yaml    seq.yaml 
when1.yaml
debug1.yaml    fact.yaml      ip.txt                      list.yaml                 
shell.yml
exo2.yaml        fact1.yaml    item_users.yaml    nginx.yaml               
template.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo3.yaml      handler.yaml          items.yaml               
rep.yaml              when.yaml
debug.yaml      exo4.yaml      index.html              items_users.yaml    seq.yaml 
when1.yaml
debug1.yaml    fact.yaml      ip.txt                      list.yaml                 
shell.yml
exo2.yaml        fact1.yaml    item_users.yaml    nginx.yaml               
template.yaml
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefin                  ed variable. The error was: 'user' is undefined\n\nThe error
appears to be in '/home/an                  sadmin/item_users.yaml': line 7, column
5, but may\nbe elsewhere in the file depending                   on the exact syntax
problem.\n\nThe offending line appears to be:\n\n    tasks:\n    - name             
: creation d'utilisateurs\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefi                  ned variable. The error was: 'user' is undefined\n\nThe error
appears to be in '/home/a                  nsadmin/item_users.yaml': line 7, column
5, but may\nbe elsewhere in the file depending                  on the exact syntax
problem.\n\nThe offending line appears to be:\n\n    tasks:\n    - nam               
e: creation d'utilisateurs\n        ^ here\n"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
failed: [146.59.158.16] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}^L
failed: [146.59.158.16] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
failed: [146.59.158.16] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}
failed: [146.59.158.16] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                   uid,
update_password"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
changed: [146.59.158.16] => (item=user1.txt)
changed: [141.95.160.133] => (item=user1.txt)
ok: [146.59.158.16] => (item=user2.txt)
ok: [141.95.160.133] => (item=user2.txt)
ok: [146.59.158.16] => (item=user3.txt)
ok: [141.95.160.133] => (item=user3.txt)
ok: [146.59.158.16] => (item=user4.txt)
ok: [141.95.160.133] => (item=user4.txt)
ok: [146.59.158.16] => (item=user5.txt)
ok: [141.95.160.133] => (item=user5.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim item_users.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
ok: [146.59.158.16] => (item=user1.txt)
ok: [141.95.160.133] => (item=user1.txt)
ok: [146.59.158.16] => (item=user2.txt)
ok: [141.95.160.133] => (item=user2.txt)
ok: [146.59.158.16] => (item=user3.txt)
ok: [141.95.160.133] => (item=user3.txt)
ok: [146.59.158.16] => (item=user4.txt)
ok: [141.95.160.133] => (item=user4.txt)
ok: [146.59.158.16] => (item=user5.txt)
ok: [141.95.160.133] => (item=user5.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

    System information as of Tue Oct    4 12:03:00 UTC 2022

    System load:                      0.91


    Usage of /:                        13.7% of 38.58GB
    Memory usage:                    48%
    Swap usage:                        0%
    Processes:                          139
    Users logged in:              1
    IPv4 address for ens3: 146.59.156.114
    IPv6 address for ens3: 2001:41d0:304:200::9356

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Tue Oct    4 09:46:14 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ ansible-playbook seq.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*************************************************
changed: [146.59.158.16] => (item=20)
changed: [141.95.160.133] => (item=20)
changed: [146.59.158.16] => (item=21)
changed: [141.95.160.133] => (item=21)
changed: [146.59.158.16] => (item=22)
changed: [141.95.160.133] => (item=22)
changed: [146.59.158.16] => (item=23)
changed: [141.95.160.133] => (item=23)
changed: [146.59.158.16] => (item=24)
changed: [141.95.160.133] => (item=24)
changed: [146.59.158.16] => (item=25)
changed: [141.95.160.133] => (item=25)
changed: [146.59.158.16] => (item=26)
changed: [141.95.160.133] => (item=26)
changed: [146.59.158.16] => (item=27)
changed: [141.95.160.133] => (item=27)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim rep.yaml


ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp"
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | Dev"
146.59.158.16 | FAILED | rc=127 >>
/bin/sh: 1: Dev: not foundnon-zero return code
141.95.160.133 | FAILED | rc=127 >>
/bin/sh: 1: Dev: not foundnon-zero return code
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
^[[C146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops27.txt
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo2.yaml    fact1.yaml        item_users.yaml      nginx.yaml   
template.yaml
copie.yaml      exo3.yaml    handler.yaml    items.yaml                rep.yaml     
when.yaml
debug.yaml      exo4.yaml    index.html        items_users.yaml    seq.yaml       
when1.yaml
debug1.yaml    fact.yaml    ip.txt                list.yaml                 
shell.yml
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo2.yaml    fact1.yaml        item_users.yaml      nginx.yaml   
template.yaml
copie.yaml      exo3.yaml    handler.yaml    items.yaml                rep.yaml     
when.yaml
debug.yaml      exo4.yaml    index.html        items_users.yaml    seq.yaml       
when1.yaml
debug1.yaml    fact.yaml    ip.txt                list.yaml                 
shell.yml
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Could not find or
access                   'index.html.j2'\nSearched
in:\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansadm                 
in/index.html.j2\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansadmin/
index.html                  .j2 on the Ansible Controller.\nIf you are using a module
and expect the file to exist                   on the remote, see the remote_src
option"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Could not find or
access                  'index.html.j2'\nSearched
in:\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansad                 
min/index.html.j2\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansadmin/
index.htm                  l.j2 on the Ansible Controller.\nIf you are using a module
and expect the file to exist                  on the remote, see the remote_src
option"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ 146.59.158.16^C
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                  'ansible_all_ipv4_adresses' is
undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_all_ipv4_adresses' is
undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim index.html.j2


ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                  'ansible_all_ipv4_adresses' is
undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_all_ipv4_adresses' is
undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp index.html.j2 index.html1.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                  'ansible_user' is undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_user' is undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                  'ansible_ssh_user' is undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_ssh_user' is undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ cp template.yaml template1.yaml
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: user, template

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - user:
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml            index.html1.j2        nginx.yaml           
when.yaml
copie.yaml      fact.yaml            ip.txt                        rep.yaml         
when1.yaml
debug.yaml      fact1.yaml          item_users.yaml      seq.yaml
debug1.yaml    handler.yaml      items.yaml                shell.yml
exo2.yaml        index.html          items_users.yaml    template.yaml
exo3.yaml        index.html.j2    list.yaml                  template1.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: user, template

The error appears to be in '/home/ansadmin/template1.yaml': line 7, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: user, template

The error appears to be in '/home/ansadmin/template1.yaml': line 9, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$ w
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! A malformed block was encountered while loading tasks: {'template': None,
'src':                  'index.html1', 'dest': '/var/www/html/index.html1'} should
be a list or None but is <c                  lass
'ansible.parsing.yaml.objects.AnsibleMapping'>

The error appears to be in '/home/ansadmin/template1.yaml': line 2, column 3, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: exemple avec template
    ^ here
ansadmin@svl200:~$ wq
wq: command not found
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-vault create hello.yml
New Vault password: [ERROR]: User interrupted execution
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-vault create hello.yaml
New Vault password:
Confirm New Vault password:
ansadmin@svl200:~$ cp
.ansible/                    cible1.txt                  handler.yaml             
list.yaml
.bash_history            copie.yaml                  hello.yaml                 
nginx.yaml
.bash_logout              debug.yaml                  index.html                 
rep.yaml
.bashrc                        debug1.yaml                index.html.j2           
seq.yaml
.exo4.yaml.swp          exo2.yaml                    index.html1.j2         
shell.yml
.handler.yaml.swp    exo3.yaml                    ip.txt                         
template.yaml
.profile                      exo4.yaml                    item_users.yaml       
template1.yaml
.ssh/                            fact.yaml                    items.yaml             
when.yaml
.viminfo                      fact1.yaml                  items_users.yaml     
when1.yaml
ansadmin@svl200:~$ cat template1.yaml >> hello.yaml
ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$ ansible-playbook hello.yaml
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/hello.yaml': line 15, column 1, but may


be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook hello.yaml --ask-vault-pass
Vault password:
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/hello.yaml': line 15, column 1, but may


be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-vault edit
Vault password:
ansadmin@svl200:~$ ansible-vault create hello.yml
New Vault password:
Confirm New Vault password:
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$ ansible-playbook hello.yaml --ask-vault-pass
Vault password:
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/hello.yaml': line 15, column 1, but may


be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook hello.yaml --ask-vault-pass
Vault password:
[WARNING]: Found variable using reserved name: port

PLAY [play with vault]


*************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo variable]


***************************************************************************
ok: [146.59.158.16] => {
        "msg": "L'utilisateur ofi03 utilise le port 80 sur la machine master-wildfly"
}
ok: [141.95.160.133] => {
        "msg": "L'utilisateur ofi03 utilise le port 80 sur la machine slave1-wildfly"
}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescgnored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescgnored=0

ansadmin@svl200:~$ sudo vim hello.yaml


ansadmin@svl200:~$ ansible-vault encrypt when2.yaml
New Vault password:
Confirm New Vault password:
ERROR! Unable to read source file (/home/ansadmin/when2.yaml): [Errno 2] No such file
or directo/ansadmin/when2.yaml'
ansadmin@svl200:~$ ansible-vault encrypt hello.yaml
New Vault password:
Confirm New Vault password:
Encryption successful
ansadmin@svl200:~$
ansadmin@svl200:~$ cat hello.y
hello.yaml    hello.yml
ansadmin@svl200:~$ cat hello.yaml
$ANSIBLE_VAULT;1.1;AES256
36393466663530663832326138373032333162303465386232666666643638646130303137366137
6137666236326535653833333234373237343936613331340a383331316661363235323737336239
35313137363135336663326139383730336265613532353038303633346337313964643666346538
6363333135363636350a623231333466643832636463383635663564623636633931353861373938
31663065653239396361386539323035663065656332383738303733313365376234376532363235
64393030303066363362626234626334623062306632626231353965333361373036633463363432
62653336663163336666616566653065656236613736663736393530316263636638633130396264
35333465623035633165366131386230363137366537386534646334373537376563343662323134
37643633303237616466383633363338383831386136666231363332323334613061366230326430
31313661616266373233653461613237633934306363316664313365333937626163623764333039
63646336383939313362303630333863373630626361333135623137323463333431663366396565
34353865393865363737316233363131393432333363306365613037653736343433646561613937
64393663353432363736646535386263666266376231376532356430363761636266663332346530
65633634653730396639393933386434326130313165663437373939633132393031373661653530
33616464633335643666616465633964336461613436303231643636333035656366333931636365
31353261376431613431323563333137633165613033343937353162393161353433396137633232
3239
ansadmin@svl200:~$ ansible-vault decrypt hello.yaml
Vault password:
Decryption successful
ansadmin@svl200:~$ cat hello.yaml
---
- name: play with vault
    hosts: all
    become: true

    vars:
          - user: ofi03
          - port: 80

    tasks:
          - name: echo variable
              debug:
                  msg: "L'utilisateur {{user}} utilise le port {{port}} sur la
machine {{ansible_hostname

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim play-vars.yaml
ansadmin@svl200:~$ ansible-playbook play-vars.yaml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [Affichage nom distribution et version]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "template error while templating string:
expected tokint statement', got 'distribution'. String: Le nom de la distribution est
{{ansible distributionion est {{ansible_version}}"}
fatal: [141.95.160.133]: FAILED! => {"msg": "template error while templating string:
expected torint statement', got 'distribution'. String: Le nom de la distribution est
{{ansible distributiosion est {{ansible_version}}"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        rescred=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        rescred=0

ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-vault create play-vars.yml
New Vault password:
Confirm New Vault password:
ansadmin@svl200:~$ cat play-vars.yaml >> play-vars.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:
PLAY [Affichage d'une variable globale]
********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "template error while templating string:
expected tokint statement', got 'distribution'. String: Le nom de la distribution est
{{ansible distributionion est {{ansible_version}}"}
fatal: [141.95.160.133]: FAILED! => {"msg": "template error while templating string:
expected torint statement', got 'distribution'. String: Le nom de la distribution est
{{ansible distributiosion est {{ansible_version}}"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        rescred=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        rescred=0

ansadmin@svl200:~$ sudo vim play-vars.yml


ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***************************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full': 'r': 2, 'minor': 9, 'revision': 6}"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full': 'r': 2, 'minor': 9, 'revision': 6}"
}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0

ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***************************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full': 'r': 2, 'minor': 9, 'revision': 6}"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full': 'r': 2, 'minor': 9, 'revision': 6}"
}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0

ansadmin@svl200:~$ sudo vim play-vars.yml


ansadmin@svl200:~$ ansible ansiblecli -m setup | grep "version"
[WARNING]: Could not match supplied host pattern, ignoring: ansiblecli
[WARNING]: No hosts matched, nothing to do
ansadmin@svl200:~$ ansible ansiblecli -m setup | grep "version"
[WARNING]: Could not match supplied host pattern, ignoring: ansiblecli
[WARNING]: No hosts matched, nothing to do
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***************************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full': 'r': 2, 'minor': 9, 'revision': 6}"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full': 'r': 2, 'minor': 9, 'revision': 6}"
}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0

ansadmin@svl200:~$ sudo vim play-vars.yml


ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***************************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est 20"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est 20"
}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ cat play-vars.yml >> locale.yml
-bash: locale.yml: Permission denied
ansadmin@svl200:~$ sudo cat play-vars.yml >> locale.yml
-bash: locale.yml: Permission denied
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ ansible-playbook locale.yml
ERROR! Syntax Error while loading YAML.
    found unacceptable key (unhashable type: 'AnsibleMapping')

The error appears to be in '/home/ansadmin/locale.yml': line 12, column 15, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:

            debug:
                msg: {{port_http}}
                            ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ ansible-playbook locale.yml

PLAY [Affichage d'une variable locale]


*********************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var locale port]


*************************************************************************
ok: [146.59.158.16] => {
        "msg": 8080
}
ok: [141.95.160.133] => {
        "msg": 8080
}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        rescred=0

ansadmin@svl200:~$ sudo vim locale.yml


ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ ansible-playbook var_dic.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/var_dic.yml': line 13, column 32, but m   


ay
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                        debug:
                            msg: "{{service["name"]    {{service.rpm}}"
                                                              ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ ansible-playbook var_dic.yml

PLAY [variable locale de type dictionnaire] **************************************

TASK [Gathering Facts] ***********************************************************


ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var dict] ******************************************************************


ok: [146.59.158.16] => {
        "msg": "apache et httpd"
}
ok: [141.95.160.133] => {
        "msg": "apache et httpd"
}

PLAY RECAP ***********************************************************************


141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        ski                            pped=0        rescued=0       
ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        ski                            pped=0        rescued=0       
ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp var_dic.yml var_dic1.yml
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (rpm). Using last defined value only.

PLAY [variable locale de type dictionnaire] **************************************


TASK [Gathering Facts] ***********************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var dict] ******************************************************************


fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an un   
defined variable. The error was: 'None' has no attribute 'name'\n\nThe error appea   
rs to be in '/home/ansadmin/var_dic1.yml': line 15, column 13, but may\nbe elsewhe   
re in the file depending on the exact syntax problem.\n\nThe offending line appear   
s to be:\n\n    tasks:\n                    - name: var dict\n                       
^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an u   
ndefined variable. The error was: 'None' has no attribute 'name'\n\nThe error appe   
ars to be in '/home/ansadmin/var_dic1.yml': line 15, column 13, but may\nbe elsewh   
ere in the file depending on the exact syntax problem.\n\nThe offending line appea   
rs to be:\n\n    tasks:\n                    - name: var dict\n                     
^ here\n"}

PLAY RECAP ***********************************************************************


141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      ski                            pped=0        rescued=0       
ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      ski                            pped=0        rescued=0       
ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/var_dic1.yml': line 20, column 1, but m   


ay
be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (rpm). Using last defined value only.

PLAY [variable locale de type dictionnaire]


********************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var dict]


************************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "template error while templating string:
unex                pected '}'. String: {{service[type]['name']}} et {{service[type]
['rpm']}"}
fatal: [141.95.160.133]: FAILED! => {"msg": "template error while templating string:
une                xpected '}'. String: {{service[type]['name']}} et {{service[type]
['rpm']}"}

PLAY RECAP
*****************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14,
found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14,
found a duplicate dict key (rpm). Using last defined value only.
ERROR! conflicting action statements: debug, msg

The error appears to be in '/home/ansadmin/var_dic1.yml': line 15, column 9, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
            - name: var dict
                ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column
14, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column
14, found a duplicate dict key (rpm). Using last defined value only.
ERROR! conflicting action statements: debug, msg

The error appears to be in '/home/ansadmin/var_dic1.yml': line 15, column 5, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
    - name: var dict
        ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service apache    httpd"
}
ok: [141.95.160.133] => {
        "msg": "Le service apache    httpd"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic1.yml


ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service apache era installé par le paquethttpd"
}
ok: [141.95.160.133] => {
        "msg": "Le service apache era installé par le paquethttpd"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
PLAY [variable locale de type dictionnaire]
************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb era installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb era installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic1.yml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic1.yml


ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/var_dic1.yml': line 11, column 9, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                    rpm: httpd
                db:
                ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined va        riable. The error was: 'list object' has no attribute 'db'\n\nThe
error appears to be in '/h        ome/ansadmin/var_dic1.yml': line 16, column 5, but
may\nbe elsewhere in the file depending o        n the exact syntax problem.\n\nThe
offending line appears to be:\n\n    tasks:\n    - name: vari        able
dictionnaire\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined v        ariable. The error was: 'list object' has no attribute 'db'\n\nThe
error appears to be in '/        home/ansadmin/var_dic1.yml': line 16, column 5, but
may\nbe elsewhere in the file depending         on the exact syntax problem.\n\nThe
offending line appears to be:\n\n    tasks:\n    - name: var        iable
dictionnaire\n        ^ here\n"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [variable dictionnaire]
***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp vim var_dic1.yml var_dic2.yml
cp: target 'var_dic2.yml' is not a directory
ansadmin@svl200:~$ cp var_dic1.yml var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ mv var_dic2.yml vars.yml
ansadmin@svl200:~$ sudo vim vars.yml
ansadmin@svl200:~$ sudo vim vars_files.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ mv var_dic2.yml vars.yml
mv: cannot stat 'var_dic2.yml': No such file or directory
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ mv var_dic1.yml var
var_dic.yml      var_dic1.yml    vars.yml
ansadmin@svl200:~$ mv var_dic1.yml var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ ansible-playbook var_dic2.yml
ERROR! 'vars_file' is not a valid attribute for a Play

The error appears to be in '/home/ansadmin/var_dic2.yml': line 2, column 3, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: variable locale de type dictionnaire
    ^ here
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ ansible-playbook var_dic2.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic2.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic2.yml --extra-vars="type=web"

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service apache sera installé par le paquethttpd"
}
ok: [141.95.160.133] => {
        "msg": "Le service apache sera installé par le paquethttpd"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic2.yml


ansadmin@svl200:~$
ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
───────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
Remote side unexpectedly closed network connection

─────────────────────────────────────────────────────────────────────────────────────
───────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

10 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Tue Oct    4 12:03:03 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml          index.html              items_users.yaml   
rep.yaml                var_dic2.yml
copie.yaml      fact.yaml          index.html.j2        list.yaml                 
seq.yaml                vars.yml
debug.yaml      fact1.yaml        index.html1.j2      locale.yml               
shell.yml              when.yaml
debug1.yaml    handler.yaml    ip.txt                      nginx.yaml               
template.yaml      when1.yaml
exo2.yaml        hello.yaml        item_users.yaml    play-vars.yaml       
template1.yaml
exo3.yaml        hello.yml          items.yaml              play-vars.yml         
var_dic.yml
ansadmin@svl200:~$ cp var_dic2.yml var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim vars_multi.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ ansible-playbook var_dic
var_dic.yml                  var_dic2.yml                var_dic_multi3.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
ERROR! Syntax Error while loading YAML.
    found unacceptable key (unhashable type: 'AnsibleMapping')

The error appears to be in '/home/ansadmin/var_dic_multi3.yml': line 11, column 15,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        user:
              name: {{item.key}}
                            ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml

PLAY [variable locale de type dictionnaire multi dimensions]


*******************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire MultiDim]


******************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined va        riable. The error was: 'item' is undefined\n\nThe error appears
to be in '/home/ansadmin/var        _dic_multi3.yml': line 9, column 5, but may\nbe
elsewhere in the file depending on the exact        syntax problem.\n\nThe offending
line appears to be:\n\n    tasks:\n    - name: variable dictio        nnaire
MultiDim\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined v        ariable. The error was: 'item' is undefined\n\nThe error appears
to be in '/home/ansadmin/va        r_dic_multi3.yml': line 9, column 5, but may\nbe
elsewhere in the file depending on the exac        t syntax problem.\n\nThe offending
line appears to be:\n\n    tasks:\n    - name: variable dicti        onnaire
MultiDim\n        ^ here\n"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic_multi3.yml': line 10, column 11,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: variable dictionnaire MultiDim


            user:
                    ^ here
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim vars_multi.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml

PLAY [variable locale de type dictionnaire multi dimensions]


*******************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire MultiDim]


******************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined va        riable. The error was: 'item' is undefined\n\nThe error appears
to be in '/home/ansadmin/var        _dic_multi3.yml': line 9, column 5, but may\nbe
elsewhere in the file depending on the exact        syntax problem.\n\nThe offending
line appears to be:\n\n    tasks:\n    - name: variable dictio        nnaire
MultiDim\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined v        ariable. The error was: 'item' is undefined\n\nThe error appears
to be in '/home/ansadmin/va        r_dic_multi3.yml': line 9, column 5, but may\nbe
elsewhere in the file depending on the exac        t syntax problem.\n\nThe offending
line appears to be:\n\n    tasks:\n    - name: variable dicti        onnaire
MultiDim\n        ^ here\n"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                rescued=0        ignored=0
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
ERROR! Syntax Error while loading YAML.
    found unacceptable key (unhashable type: 'AnsibleMapping')

The error appears to be in '/home/ansadmin/var_dic_multi3.yml': line 11, column 16,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        user:
                name: {{item.key}}
                              ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
ERROR! Syntax Error while loading YAML.
    found unacceptable key (unhashable type: 'AnsibleMapping')

The error appears to be in '/home/ansadmin/var_dic_multi3.yml': line 11, column 16,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        user:
                name: {{item.key}}
                              ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
PLAY [variable locale de type dictionnaire multi dimensions]
*******************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire MultiDim]


******************************************************
changed: [146.59.158.16] => (item={'key': 'antoine', 'value': {'group': 'users',
'state': 'p        resent'}})
changed: [141.95.160.133] => (item={'key': 'antoine', 'value': {'group': 'users',
'state': '        present'}})
changed: [146.59.158.16] => (item={'key': 'erwan', 'value': {'group': 'users',
'state': 'pre        sent'}})
changed: [141.95.160.133] => (item={'key': 'erwan', 'value': {'group': 'users',
'state': 'pr        esent'}})
ok: [146.59.158.16] => (item={'key': 'philippe', 'value': {'group': 'users', 'state':
'absen        t'}})
ok: [141.95.160.133] => (item={'key': 'philippe', 'value': {'group': 'users',
'state': 'abse        nt'}})

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=1      unreachable=0   
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=1      unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic_multi3.yml


ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ cat var_dic_multi3.yml
---
- name: variable locale de type dictionnaire multi dimensions
    hosts: all
    become: true
    vars_files:
        - /home/ansadmin/vars_multi.yml

    tasks:
    - name: variable dictionnaire MultiDim
        user:
                name: "{{item.key}}"
                group: "{{item.value.group}}"
                state: "{{item.value.state}}"
        ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

Last login: Mon Oct    3 08:26:57 2022 from 176.160.191.208


ofi03@svl200:~$

Network error: Software caused connection abort


~
────────────────────────────────────────────────────────────────────────────────
~
Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"handler.yaml" [New File]                                                           
0,0-1                  All
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.
      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Mon Oct    3 13:13:55 2022 from 176.160.191.208
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ vim handler.yaml
ansadmin@svl200:~$ sudo vim handler.yaml
ansadmin@svl200:~$ sudo vim index.html
ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [146.59.158.16]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]

TASK [copy index.html]


***************************************************************
changed: [146.59.158.16]

RUNNING HANDLER [restart_nginx]


******************************************************
changed: [146.59.158.16]

PLAY RECAP
***************************************************************************
146.59.158.16                            : ok=4        changed=2        unreachable=0
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ 146.59.158.16 ^C
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$ sudo vim handler.yaml
ansadmin@svl200:~$ ansible-playbook handler.yaml
[WARNING]: Could not match supplied host pattern, ignoring: cible{1
[WARNING]: Could not match supplied host pattern, ignoring: 2}

PLAY [configure webserver with nginx]


************************************************
skipping: no hosts matched
PLAY RECAP
***************************************************************************

ansadmin@svl200:~$ sudo vim handler.yaml


ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [copy index.html]


***************************************************************
ok: [146.59.158.16]
changed: [141.95.160.133]

RUNNING HANDLER [restart_nginx]


******************************************************
changed: [141.95.160.133]

PLAY RECAP
***************************************************************************
141.95.160.133                          : ok=4        changed=2        unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0
146.59.158.16                            : ok=3        changed=0        unreachable=0
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim handler.yaml


ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [copy index.html]


***************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
PLAY RECAP
***************************************************************************
141.95.160.133                          : ok=3        changed=0        unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0
146.59.158.16                            : ok=3        changed=0        unreachable=0
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim handler.yaml


ansadmin@svl200:~$ sudo vim index.html
ansadmin@svl200:~$ ansible-playbook handler.yaml

PLAY [configure webserver with nginx]


************************************************

TASK [Gathering Facts]


***************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install    nginx]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [copy index.html]


***************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

RUNNING HANDLER [restart_nginx]


******************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
***************************************************************************
141.95.160.133                          : ok=4        changed=2        unreachable=0 
failed=0        skipped                    =0        rescued=0        ignored=0
146.59.158.16                            : ok=4        changed=2        unreachable=0
failed=0        skipped                    =0        rescued=0        ignored=0

ansadmin@svl200:~$ vim /etc/ansible/hosts


ansadmin@svl200:~$ vim /etc/ssh/sshd_config
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible cible1 -m setup
146.59.158.16 | SUCCESS => {
        "ansible_facts": {
                "ansible_all_ipv4_addresses": [
                        "146.59.158.16"
                ],
                "ansible_all_ipv6_addresses": [
                        "2001:41d0:304:200::951d",
                        "fe80::f816:3eff:fee6:102e"
                ],
                "ansible_apparmor": {
                        "status": "enabled"
                },
                "ansible_architecture": "x86_64",
                "ansible_bios_date": "04/01/2014",
                "ansible_bios_version": "2:1.10.2-58953eb7",
                "ansible_cmdline": {
                        "BOOT_IMAGE": "/boot/vmlinuz-5.4.0-122-generic",
                        "console": "ttyS0",
                        "ro": true,
                        "root": "LABEL=cloudimg-rootfs"
                },
                "ansible_date_time": {
                        "date": "2022-10-03",
                        "day": "03",
                        "epoch": "1664805080",
                        "hour": "13",
                        "iso8601": "2022-10-03T13:51:20Z",
                        "iso8601_basic": "20221003T135120753276",
                        "iso8601_basic_short": "20221003T135120",
                        "iso8601_micro": "2022-10-03T13:51:20.753373Z",
                        "minute": "51",
                        "month": "10",
                        "second": "20",
                        "time": "13:51:20",
                        "tz": "UTC",
                        "tz_offset": "+0000",
                        "weekday": "Monday",
                        "weekday_number": "1",
                        "weeknumber": "40",
                        "year": "2022"
                },
                "ansible_default_ipv4": {
                        "address": "146.59.158.16",
                        "alias": "ens3",
                        "broadcast": "global",
                        "gateway": "146.59.156.1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:e6:10:2e",
                        "mtu": 1500,
                        "netmask": "255.255.255.255",
                        "network": "146.59.158.16",
                        "type": "ether"
                },
                "ansible_default_ipv6": {
                        "address": "2001:41d0:304:200::951d",
                        "gateway": "2001:41d0:304:200::1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:e6:10:2e",
                        "mtu": 1500,
                        "prefix": "56",
                        "scope": "global",
                        "type": "ether"
                },
                "ansible_device_links": {
                        "ids": {
                                "sda": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0"
                                ],
                                "sda1": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-
part1"
                                ],
                                "sda14": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-
part14"
                                ],
                                "sda15": [
                                        "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-
part15"
                                ]
                        },
                        "labels": {
                                "sda1": [
                                        "cloudimg-rootfs"
                                ],
                                "sda15": [
                                        "UEFI"
                                ]
                        },
                        "masters": {},
                        "uuids": {
                                "sda1": [
                                        "f209b90d-e073-4df4-950a-9c8620c2292b"
                                ],
                                "sda15": [
                                        "C957-9CB6"
                                ]
                        }
                },
                "ansible_devices": {
                        "loop0": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "126888",
                                "sectorsize": "512",
                                "size": "61.96 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop1": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "96176",
                                "sectorsize": "512",
                                "size": "46.96 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop10": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "98272",
                                "sectorsize": "512",
                                "size": "47.98 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop11": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "0",
                                "sectorsize": "512",
                                "size": "0.00 Bytes",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop2": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "138880",
                                "sectorsize": "512",
                                "size": "67.81 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop3": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "126888",
                                "sectorsize": "512",
                                "size": "61.96 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop4": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "233448",
                                "sectorsize": "512",
                                "size": "113.99 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop5": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "8688",
                                "sectorsize": "512",
                                "size": "4.24 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop6": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "129480",
                                "sectorsize": "512",
                                "size": "63.22 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop7": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "98288",
                                "sectorsize": "512",
                                "size": "47.99 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop8": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "235368",
                                "sectorsize": "512",
                                "size": "114.93 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "loop9": {
                                "holders": [],
                                "host": "",
                                "links": {
                                        "ids": [],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": null,
                                "partitions": {},
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "235496",
                                "sectorsize": "512",
                                "size": "114.99 MB",
                                "support_discard": "4096",
                                "vendor": null,
                                "virtual": 1
                        },
                        "sda": {
                                "holders": [],
                                "host": "SCSI storage controller: Red Hat, Inc.
Virtio SCSI",
                                "links": {
                                        "ids": [
                                                "scsi-0QEMU_QEMU_HARDDISK_drive-
scsi0-0-0-0"
                                        ],
                                        "labels": [],
                                        "masters": [],
                                        "uuids": []
                                },
                                "model": "QEMU HARDDISK",
                                "partitions": {
                                        "sda1": {
                                                "holders": [],
                                                "links": {
                                                        "ids": [
                                                                "scsi-
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-part1"
                                                        ],
                                                        "labels": [
                                                                "cloudimg-rootfs"
                                                        ],
                                                        "masters": [],
                                                        "uuids": [
                                                                "f209b90d-e073-4df4-
950a-9c8620c2292b"
                                                        ]
                                                },
                                                "sectors": "83658719",
                                                "sectorsize": 512,
                                                "size": "39.89 GB",
                                                "start": "227328",
                                                "uuid": "f209b90d-e073-4df4-950a-
9c8620c2292b"
                                        },
                                        "sda14": {
                                                "holders": [],
                                                "links": {
                                                        "ids": [
                                                                "scsi-
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-part14"
                                                        ],
                                                        "labels": [],
                                                        "masters": [],
                                                        "uuids": []
                                                },
                                                "sectors": "8192",
                                                "sectorsize": 512,
                                                "size": "4.00 MB",
                                                "start": "2048",
                                                "uuid": null
                                        },
                                        "sda15": {
                                                "holders": [],
                                                "links": {
                                                        "ids": [
                                                                "scsi-
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0-part15"
                                                        ],
                                                        "labels": [
                                                                "UEFI"
                                                        ],
                                                        "masters": [],
                                                        "uuids": [
                                                                "C957-9CB6"
                                                        ]
                                                },
                                                "sectors": "217088",
                                                "sectorsize": 512,
                                                "size": "106.00 MB",
                                                "start": "10240",
                                                "uuid": "C957-9CB6"
                                        }
                                },
                                "removable": "0",
                                "rotational": "1",
                                "sas_address": null,
                                "sas_device_handle": null,
                                "scheduler_mode": "mq-deadline",
                                "sectors": "83886080",
                                "sectorsize": "512",
                                "size": "40.00 GB",
                                "support_discard": "4096",
                                "vendor": "QEMU",
                                "virtual": 1
                        }
                },
                "ansible_distribution": "Ubuntu",
                "ansible_distribution_file_parsed": true,
                "ansible_distribution_file_path": "/etc/os-release",
                "ansible_distribution_file_variety": "Debian",
                "ansible_distribution_major_version": "20",
                "ansible_distribution_release": "focal",
                "ansible_distribution_version": "20.04",
                "ansible_dns": {
                        "nameservers": [
                                "127.0.0.53"
                        ],
                        "options": {
                                "edns0": true,
                                "trust-ad": true
                        },
                        "search": [
                                "openstacklocal"
                        ]
                },
                "ansible_domain": "vps.ovh.net",
                "ansible_effective_group_id": 1006,
                "ansible_effective_user_id": 1006,
                "ansible_ens3": {
                        "active": true,
                        "device": "ens3",
                        "features": {
                                "esp_hw_offload": "off [fixed]",
                                "esp_tx_csum_hw_offload": "off [fixed]",
                                "fcoe_mtu": "off [fixed]",
                                "generic_receive_offload": "on",
                                "generic_segmentation_offload": "on",
                                "highdma": "on [fixed]",
                                "hw_tc_offload": "off [fixed]",
                                "l2_fwd_offload": "off [fixed]",
                                "large_receive_offload": "off [fixed]",
                                "loopback": "off [fixed]",
                                "netns_local": "off [fixed]",
                                "ntuple_filters": "off [fixed]",
                                "receive_hashing": "off [fixed]",
                                "rx_all": "off [fixed]",
                                "rx_checksumming": "on [fixed]",
                                "rx_fcs": "off [fixed]",
                                "rx_gro_hw": "on",
                                "rx_udp_tunnel_port_offload": "off [fixed]",
                                "rx_vlan_filter": "on [fixed]",
                                "rx_vlan_offload": "off [fixed]",
                                "rx_vlan_stag_filter": "off [fixed]",
                                "rx_vlan_stag_hw_parse": "off [fixed]",
                                "scatter_gather": "on",
                                "tcp_segmentation_offload": "on",
                                "tls_hw_record": "off [fixed]",
                                "tls_hw_rx_offload": "off [fixed]",
                                "tls_hw_tx_offload": "off [fixed]",
                                "tx_checksum_fcoe_crc": "off [fixed]",
                                "tx_checksum_ip_generic": "on",
                                "tx_checksum_ipv4": "off [fixed]",
                                "tx_checksum_ipv6": "off [fixed]",
                                "tx_checksum_sctp": "off [fixed]",
                                "tx_checksumming": "on",
                                "tx_esp_segmentation": "off [fixed]",
                                "tx_fcoe_segmentation": "off [fixed]",
                                "tx_gre_csum_segmentation": "off [fixed]",
                                "tx_gre_segmentation": "off [fixed]",
                                "tx_gso_partial": "off [fixed]",
                                "tx_gso_robust": "on [fixed]",
                                "tx_ipxip4_segmentation": "off [fixed]",
                                "tx_ipxip6_segmentation": "off [fixed]",
                                "tx_lockless": "off [fixed]",
                                "tx_nocache_copy": "off",
                                "tx_scatter_gather": "on",
                                "tx_scatter_gather_fraglist": "off [fixed]",
                                "tx_sctp_segmentation": "off [fixed]",
                                "tx_tcp6_segmentation": "on",
                                "tx_tcp_ecn_segmentation": "on",
                                "tx_tcp_mangleid_segmentation": "off",
                                "tx_tcp_segmentation": "on",
                                "tx_udp_segmentation": "off [fixed]",
                                "tx_udp_tnl_csum_segmentation": "off [fixed]",
                                "tx_udp_tnl_segmentation": "off [fixed]",
                                "tx_vlan_offload": "off [fixed]",
                                "tx_vlan_stag_hw_insert": "off [fixed]",
                                "vlan_challenged": "off [fixed]"
                        },
                        "hw_timestamp_filters": [],
                        "ipv4": {
                                "address": "146.59.158.16",
                                "broadcast": "global",
                                "netmask": "255.255.255.255",
                                "network": "146.59.158.16"
                        },
                        "ipv6": [
                                {
                                        "address": "2001:41d0:304:200::951d",
                                        "prefix": "56",
                                        "scope": "global"
                                },
                                {
                                        "address": "fe80::f816:3eff:fee6:102e",
                                        "prefix": "64",
                                        "scope": "link"
                                }
                        ],
                        "macaddress": "fa:16:3e:e6:10:2e",
                        "module": "virtio_net",
                        "mtu": 1500,
                        "pciid": "virtio0",
                        "promisc": false,
                        "speed": -1,
                        "timestamping": [
                                "tx_software",
                                "rx_software",
                                "software"
                        ],
                        "type": "ether"
                },
                "ansible_env": {
                        "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1006/bus",
                        "HOME": "/home/ansadmin",
                        "LANG": "C.UTF-8",
                        "LOGNAME": "ansadmin",
                        "MOTD_SHOWN": "pam",
                        "PATH":
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games       
/usr/local/games:/snap/bin",
                        "PWD": "/home/ansadmin",
                        "SHELL": "/bin/bash",
                        "SHLVL": "0",
                        "SSH_CLIENT": "146.59.156.114 35036 55600",
                        "SSH_CONNECTION": "146.59.156.114 35036 146.59.158.16 55600",
                        "SSH_TTY": "/dev/pts/2",
                        "TERM": "xterm",
                        "USER": "ansadmin",
                        "XDG_RUNTIME_DIR": "/run/user/1006",
                        "XDG_SESSION_CLASS": "user",
                        "XDG_SESSION_ID": "468",
                        "XDG_SESSION_TYPE": "tty",
                        "_": "/bin/sh"
                },
                "ansible_fibre_channel_wwn": [],
                "ansible_fips": false,
                "ansible_form_factor": "Other",
                "ansible_fqdn": "vps-698c29b2.vps.ovh.net",
                "ansible_hostname": "master-wildfly",
                "ansible_hostnqn": "",
                "ansible_interfaces": [
                        "lo",
                        "ens3"
                ],
                "ansible_is_chroot": false,
                "ansible_iscsi_iqn": "",
                "ansible_kernel": "5.4.0-122-generic",
                "ansible_kernel_version": "#138-Ubuntu SMP Wed Jun 22 15:00:31 UTC
2022",
                "ansible_lo": {
                        "active": true,
                        "device": "lo",
                        "features": {
                                "esp_hw_offload": "off [fixed]",
                                "esp_tx_csum_hw_offload": "off [fixed]",
                                "fcoe_mtu": "off [fixed]",
                                "generic_receive_offload": "on",
                                "generic_segmentation_offload": "on",
                                "highdma": "on [fixed]",
                                "hw_tc_offload": "off [fixed]",
                                "l2_fwd_offload": "off [fixed]",
                                "large_receive_offload": "off [fixed]",
                                "loopback": "on [fixed]",
                                "netns_local": "on [fixed]",
                                "ntuple_filters": "off [fixed]",
                                "receive_hashing": "off [fixed]",
                                "rx_all": "off [fixed]",
                                "rx_checksumming": "on [fixed]",
                                "rx_fcs": "off [fixed]",
                                "rx_gro_hw": "off [fixed]",
                                "rx_udp_tunnel_port_offload": "off [fixed]",
                                "rx_vlan_filter": "off [fixed]",
                                "rx_vlan_offload": "off [fixed]",
                                "rx_vlan_stag_filter": "off [fixed]",
                                "rx_vlan_stag_hw_parse": "off [fixed]",
                                "scatter_gather": "on",
                                "tcp_segmentation_offload": "on",
                                "tls_hw_record": "off [fixed]",
                                "tls_hw_rx_offload": "off [fixed]",
                                "tls_hw_tx_offload": "off [fixed]",
                                "tx_checksum_fcoe_crc": "off [fixed]",
                                "tx_checksum_ip_generic": "on [fixed]",
                                "tx_checksum_ipv4": "off [fixed]",
                                "tx_checksum_ipv6": "off [fixed]",
                                "tx_checksum_sctp": "on [fixed]",
                                "tx_checksumming": "on",
                                "tx_esp_segmentation": "off [fixed]",
                                "tx_fcoe_segmentation": "off [fixed]",
                                "tx_gre_csum_segmentation": "off [fixed]",
                                "tx_gre_segmentation": "off [fixed]",
                                "tx_gso_partial": "off [fixed]",
                                "tx_gso_robust": "off [fixed]",
                                "tx_ipxip4_segmentation": "off [fixed]",
                                "tx_ipxip6_segmentation": "off [fixed]",
                                "tx_lockless": "on [fixed]",
                                "tx_nocache_copy": "off [fixed]",
                                "tx_scatter_gather": "on [fixed]",
                                "tx_scatter_gather_fraglist": "on [fixed]",
                                "tx_sctp_segmentation": "on",
                                "tx_tcp6_segmentation": "on",
                                "tx_tcp_ecn_segmentation": "on",
                                "tx_tcp_mangleid_segmentation": "on",
                                "tx_tcp_segmentation": "on",
                                "tx_udp_segmentation": "off [fixed]",
                                "tx_udp_tnl_csum_segmentation": "off [fixed]",
                                "tx_udp_tnl_segmentation": "off [fixed]",
                                "tx_vlan_offload": "off [fixed]",
                                "tx_vlan_stag_hw_insert": "off [fixed]",
                                "vlan_challenged": "on [fixed]"
                        },
                        "hw_timestamp_filters": [],
                        "ipv4": {
                                "address": "127.0.0.1",
                                "broadcast": "host",
                                "netmask": "255.0.0.0",
                                "network": "127.0.0.0"
                        },
                        "ipv6": [
                                {
                                        "address": "::1",
                                        "prefix": "128",
                                        "scope": "host"
                                }
                        ],
                        "mtu": 65536,
                        "promisc": false,
                        "timestamping": [
                                "tx_software",
                                "rx_software",
                                "software"
                        ],
                        "type": "loopback"
                },
                "ansible_local": {},
                "ansible_lsb": {
                        "codename": "focal",
                        "description": "Ubuntu 20.04.5 LTS",
                        "id": "Ubuntu",
                        "major_release": "20",
                        "release": "20.04"
                },
                "ansible_machine": "x86_64",
                "ansible_machine_id": "adc4dbb14d4447ada17154213d422c09",
                "ansible_memfree_mb": 222,
                "ansible_memory_mb": {
                        "nocache": {
                                "free": 1278,
                                "used": 657
                        },
                        "real": {
                                "free": 222,
                                "total": 1935,
                                "used": 1713
                        },
                        "swap": {
                                "cached": 0,
                                "free": 0,
                                "total": 0,
                                "used": 0
                        }
                },
                "ansible_memtotal_mb": 1935,
                "ansible_mounts": [
                        {
                                "block_available": 8921537,
                                "block_size": 4096,
                                "block_total": 10114671,
                                "block_used": 1193134,
                                "device": "/dev/sda1",
                                "fstype": "ext4",
                                "inode_available": 5046647,
                                "inode_total": 5160960,
                                "inode_used": 114313,
                                "mount": "/",
                                "options": "rw,relatime",
                                "size_available": 36542615552,
                                "size_total": 41429692416,
                                "uuid": "f209b90d-e073-4df4-950a-9c8620c2292b"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 543,
                                "block_used": 543,
                                "device": "/dev/loop2",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 802,
                                "inode_used": 802,
                                "mount": "/snap/lxd/22753",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 71172096,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 203074,
                                "block_size": 512,
                                "block_total": 213716,
                                "block_used": 10642,
                                "device": "/dev/sda15",
                                "fstype": "vfat",
                                "inode_available": 0,
                                "inode_total": 0,
                                "inode_used": 0,
                                "mount": "/boot/efi",
                                "options":
"rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859       
1,shortname=mixed,errors=remount-ro",
                                "size_available": 103973888,
                                "size_total": 109422592,
                                "uuid": "C957-9CB6"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 496,
                                "block_used": 496,
                                "device": "/dev/loop3",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 11796,
                                "inode_used": 11796,
                                "mount": "/snap/core20/1611",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 65011712,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 34,
                                "block_used": 34,
                                "device": "/dev/loop5",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 690,
                                "inode_used": 690,
                                "mount": "/snap/tree/18",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 4456448,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 506,
                                "block_used": 506,
                                "device": "/dev/loop6",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 11882,
                                "inode_used": 11882,
                                "mount": "/snap/core20/1623",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 66322432,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 384,
                                "block_used": 384,
                                "device": "/dev/loop7",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 486,
                                "inode_used": 486,
                                "mount": "/snap/snapd/16778",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 50331648,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 920,
                                "block_used": 920,
                                "device": "/dev/loop8",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 12845,
                                "inode_used": 12845,
                                "mount": "/snap/core/13741",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 120586240,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 920,
                                "block_used": 920,
                                "device": "/dev/loop9",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 12845,
                                "inode_used": 12845,
                                "mount": "/snap/core/13886",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 120586240,
                                "uuid": "N/A"
                        },
                        {
                                "block_available": 0,
                                "block_size": 131072,
                                "block_total": 384,
                                "block_used": 384,
                                "device": "/dev/loop10",
                                "fstype": "squashfs",
                                "inode_available": 0,
                                "inode_total": 486,
                                "inode_used": 486,
                                "mount": "/snap/snapd/17029",
                                "options": "ro,nodev,relatime",
                                "size_available": 0,
                                "size_total": 50331648,
                                "uuid": "N/A"
                        }
                ],
                "ansible_nodename": "master-wildfly",
                "ansible_os_family": "Debian",
                "ansible_pkg_mgr": "apt",
                "ansible_proc_cmdline": {
                        "BOOT_IMAGE": "/boot/vmlinuz-5.4.0-122-generic",
                        "console": [
                                "tty1",
                                "ttyS0"
                        ],
                        "ro": true,
                        "root": "LABEL=cloudimg-rootfs"
                },
                "ansible_processor": [
                        "0",
                        "GenuineIntel",
                        "Intel Core Processor (Haswell, no TSX)"
                ],
                "ansible_processor_cores": 1,
                "ansible_processor_count": 1,
                "ansible_processor_threads_per_core": 1,
                "ansible_processor_vcpus": 1,
                "ansible_product_name": "OpenStack Nova",
                "ansible_product_serial": "NA",
                "ansible_product_uuid": "NA",
                "ansible_product_version": "19.0.4",
                "ansible_python": {
                        "executable": "/usr/bin/python3",
                        "has_sslcontext": true,
                        "type": "cpython",
                        "version": {
                                "major": 3,
                                "micro": 10,
                                "minor": 8,
                                "releaselevel": "final",
                                "serial": 0
                        },
                        "version_info": [
                                3,
                                8,
                                10,
                                "final",
                                0
                        ]
                },
                "ansible_python_version": "3.8.10",
                "ansible_real_group_id": 1006,
                "ansible_real_user_id": 1006,
                "ansible_selinux": {
                        "status": "Missing selinux Python library"
                },
                "ansible_selinux_python_present": false,
                "ansible_service_mgr": "systemd",
                "ansible_ssh_host_key_dsa_public":
"AAAAB3NzaC1kc3MAAACBAP6HcF8z3pABr7Ha4Z/hiKaYFifK       
BMqCxMrB4joQeAx3e/OA93XudbdbwRmW2GtjdJf9mvVOjbvHZr44KAITI65I+MzAWn/
Bhx0cMyljGJJDyXFSQqzuwmzL       
XHbHnPAhw93kp1Ct1NOgEBTnwbhVzaQhEDQ6pmHCj/NIRyCFwLAAAAFQCPsGFnGGnYxsX59fhj2Aymc7tsfwA
AAIB7qf       
O5uJoTj2nu3mbAVI8BuVRpGS4hBUctkR1pmvTkNbKJzAxrFDynG9fMx2LKsgIqjCgNFk0YahxigpGRJuLOe3L
6b0ymXG       
QzJ2dvyB7ghpTLbRxgJa+MiZJuJlrztCrtrIjvxF1H9y2J7dLlwF9F6GsZAFCpm7uQKcLOpgDgAAAIEAoD+6L
4p4aFw7       
ev0y+ehe3JCxLLC5NvblMLDGvqkA098r1EUCWSowH24IeFRHJ+cdWtcArJNclJDaNA8oePwjuQKtubQyr4W8O
1VYTYw3        P3W6qFDeFl5yLKA9EHUmxWc8ymXDGBcmwuVH2W1ZbteSSpKS1Ycp8OxzXqEalRrYc=",
                "ansible_ssh_host_key_ecdsa_public":
"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNT       
AAABBBOn8ceAE4EDAWwmXkogeKexuv0b82zK+3VenUUR8P2cicoaQSsQ83fldYHzqhVSP5x98ZhqkHaHMgBkS
MZY8rBQ        ",
                "ansible_ssh_host_key_ed25519_public":
"AAAAC3NzaC1lZDI1NTE5AAAAIM0bpK+LEEg6bH+uMeDK        HlvcQHBfj37qCeWUF+pS2uQ",
                "ansible_ssh_host_key_rsa_public":
"AAAAB3NzaC1yc2EAAAADAQABAAABgQDByfqYTpZnEJQpKILW       
ELvPYKwSedP1hbHtGGEEymgw0dWhkKahKqNITSTPBF/0pALPm+3/IKONDAUr53cZQLngFrV+qu8rnKdaRo3OX
DZzJrWe       
ZVmlyQTmF+uA8L3e+IJitvPPm+7Aj7SrbwfBqCPLNdEfN1ausTQZK/hIPCgOfAV2Yswr93nqtOSiiybhZ6lQx
e2KsDbh       
XRjFUb4tgIUkt1Hbb3x22uqL4BAZ0htJ3EsDkwUv1VwTOc/CVs0IZryQZH1nEXJakk3z8Ibte2f75jIe1A1Vt
rYw6zQL       
8HxkGs9S4YWxQJpeJ6k9bYRJ+SF+UPS3gchon+A2rOuaOSYMUCh9RH2g8DoIDawP7BPX38HTsgu6RPciz5nb2
oDJ0iCW       
t8Zfj4rwGoigcYBWQ5NkBWHK1GpGs0wdt0VbiUlF2SzEDgJmESOn2bhyiXhoT/2OaX5lViPyjzr3NGVOO6z7V
j3HBEBq        F4+y/c4b08NiiucMDDp3CjQ5JtClE=",
                "ansible_swapfree_mb": 0,
                "ansible_swaptotal_mb": 0,
                "ansible_system": "Linux",
                "ansible_system_capabilities": [
                        ""
                ],
                "ansible_system_capabilities_enforced": "True",
                "ansible_system_vendor": "OpenStack Foundation",
                "ansible_uptime_seconds": 3303036,
                "ansible_user_dir": "/home/ansadmin",
                "ansible_user_gecos": ",,,",
                "ansible_user_gid": 1006,
                "ansible_user_id": "ansadmin",
                "ansible_user_shell": "/bin/bash",
                "ansible_user_uid": 1006,
                "ansible_userspace_architecture": "x86_64",
                "ansible_userspace_bits": "64",
                "ansible_virtualization_role": "guest",
                "ansible_virtualization_type": "openstack",
                "discovered_interpreter_python": "/usr/bin/python3",
                "gather_subset": [
                        "all"
                ],
                "module_setup": true
        },
        "changed": false
}
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible cible1 -m setup -a "filter=*family*"
146.59.158.16 | SUCCESS => {
        "ansible_facts": {
                "ansible_os_family": "Debian",
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false
}
ansadmin@svl200:~$ ansible cible2 -m setup -a "filter=*family*"
141.95.160.133 | SUCCESS => {
        "ansible_facts": {
                "ansible_os_family": "Debian",
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible cible2 -m setup -a "filter=*ip*"
141.95.160.133 | SUCCESS => {
        "ansible_facts": {
                "ansible_all_ipv4_addresses": [
                        "141.95.160.133"
                ],
                "ansible_all_ipv6_addresses": [
                        "2001:41d0:304:200::82a1",
                        "fe80::f816:3eff:fef2:cdf9"
                ],
                "ansible_default_ipv4": {
                        "address": "141.95.160.133",
                        "alias": "ens3",
                        "broadcast": "global",
                        "gateway": "141.95.160.1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:f2:cd:f9",
                        "mtu": 1500,
                        "netmask": "255.255.255.255",
                        "network": "141.95.160.133",
                        "type": "ether"
                },
                "ansible_default_ipv6": {
                        "address": "2001:41d0:304:200::82a1",
                        "gateway": "2001:41d0:304:200::1",
                        "interface": "ens3",
                        "macaddress": "fa:16:3e:f2:cd:f9",
                        "mtu": 1500,
                        "prefix": "56",
                        "scope": "global",
                        "type": "ether"
                },
                "ansible_fips": false,
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false
}
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ cat fact.yaml
---
- name: facts
    hosts: all
    become: true
    vars:
        - var1: Hello DevOps1
        - var2: Good Morning DevOps2

    tasks:
        - name: echo text
            shell: echo "{{var1}} is var1, but var2 is {{var2}} >
/home/ansadmin/{{ansible_os_fami
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ ansible-playbook fact.yaml

PLAY [facts]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


***************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                      ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                      ignored=0

ansadmin@svl200:~$ ansible all -a "ls -lrt"


146.59.158.16 | CHANGED | rc=0 >>
total 8
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
141.95.160.133 | CHANGED | rc=0 >>
total 8
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
ansadmin@svl200:~$ ansible all -a "cat Redhat.txt"
146.59.158.16 | FAILED | rc=1 >>
cat: Redhat.txt: No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=1 >>
cat: Redhat.txt: No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -a "cat RedHat.txt"
146.59.158.16 | FAILED | rc=1 >>
cat: RedHat.txt: No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=1 >>
cat: RedHat.txt: No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -a "cat Debian.txt"
146.59.158.16 | CHANGED | rc=0 >>
Hello DevOps1 is var1, but var2 is Good Morning DevOps2
141.95.160.133 | CHANGED | rc=0 >>
Hello DevOps1 is var1, but var2 is Good Morning DevOps2
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ cp fact.yaml fact1.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim ip.txt
ansadmin@svl200:~$ ansible-playbook fact1.yaml

PLAY [facts]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


***************************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined va        e error was: 'ip' is undefined\n\nThe error appears to be in
'/home/ansadmin/fact1.yaml': li        mn 7, but may\nbe elsewhere in the file
depending on the exact syntax problem.\n\nThe offend        ppears to be:\n\n   
tasks:\n        - name: echo text\n            ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined v        he error was: 'ip' is undefined\n\nThe error appears to be in
'/home/ansadmin/fact1.yaml': l        umn 7, but may\nbe elsewhere in the file
depending on the exact syntax problem.\n\nThe offen        appears to be:\n\n   
tasks:\n        - name: echo text\n            ^ here\n"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                      ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                      ignored=0
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ ansible-playbook fact1.yaml

PLAY [facts]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


***************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                      ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                      ignored=0

ansadmin@svl200:~$ sudo vim fact1.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook fact1.yaml

PLAY [facts]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo text]


***************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                      ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                      ignored=0

ansadmin@svl200:~$ sudo vim ip.txt


ansadmin@svl200:~$ cat ip.txt
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ ansible all -a "cat ip.txt"
146.59.158.16 | CHANGED | rc=0 >>
['146.59.158.16']
141.95.160.133 | CHANGED | rc=0 >>
['141.95.160.133']
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim fact1.yaml
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ cat debug.yaml
---
-name: debug
hosts: cible1
become: true
vars:
      - var1: Hello Devops

tasks:
      - name: echo test
          command: echo -e "{{var1}} is var1 it works"
          register: results

      - name: show results


          debug: msg={{results}}

ansadmin@svl200:~$ ansible-playbook debug.yaml


ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/debug.yaml': line 3, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

-name: debug
hosts: cible1
            ^ here
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ ansible-playbook debug.yaml

PLAY [debug]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]

TASK [echo test]


***************************************************************************
changed: [146.59.158.16]

TASK [show results]


************************************************************************
ok: [146.59.158.16] => {
        "msg": {
                "changed": true,
                "cmd": [
                        "echo",
                        "-e",
                        "Hello Devops is var1 it works"
                ],
                "delta": "0:00:00.003328",
                "end": "2022-10-03 15:01:22.526831",
                "failed": false,
                "rc": 0,
                "start": "2022-10-03 15:01:22.523503",
                "stderr": "",
                "stderr_lines": [],
                "stdout": "Hello Devops is var1 it works",
                "stdout_lines": [
                        "Hello Devops is var1 it works"
                ]
        }
}

PLAY RECAP
*********************************************************************************
146.59.158.16                            : ok=3        changed=1        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim debug.yaml


ansadmin@svl200:~$ ansible-playbook debug.yaml

PLAY [debug]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]

TASK [echo test]


***************************************************************************
changed: [146.59.158.16]

TASK [show results]


************************************************************************
ok: [146.59.158.16] => {
        "msg": [
                "Hello Devops is var1 it works"
        ]
}

PLAY RECAP
*********************************************************************************
146.59.158.16                            : ok=3        changed=1        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp debug.yaml debug1.yaml
ansadmin@svl200:~$ sudo vim debug1.yaml
ansadmin@svl200:~$ ansible-playbook debug1.yaml

PLAY [debug]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]

TASK [show results]


************************************************************************
ok: [146.59.158.16] => {
        "msg": "Le serveur Apache utilise par defaut le port 80 sur ma machine
Debian"
}

PLAY RECAP
*********************************************************************************
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


*************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


*************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [apt get install httpd on centos]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [apt-get install httpd on centos]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


*************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook when.yaml
PLAY [exemple avec condition when]
*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


*************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
...ignoring
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
...ignoring

TASK [install apache2 on ubuntu]


***********************************************************
ok: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=3        changed=1        unreachable=0 
failed=0        skipped=0                cued=0        ignored=1
146.59.158.16                            : ok=3        changed=0        unreachable=0
failed=0        skipped=0                cued=0        ignored=1

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$ -
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
───────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Mon Oct    3 13:16:15 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$ sudo vim when.yml
ansadmin@svl200:~$ history
        1    ssh-keygen -t rsa
        2    ssh
        3    ssh-copy-id ansadmin@146.59.156.114ssh-copy-id ansadmin@146.59.156.114
        4    sudo vim /etc/ssh/sshd_config
        5    ls -l .ssh/
        6    ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub ansadmin@146.59.158.16 -p
55600
        7    ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub ansadmin@141.95.160.133 -p
55600
        8    sudo vim /etc/ansible/hosts
        9    ansible all -m ping
      10    sudo vim /etc/ansible/hosts
      11    ansible all -m ping
      12    ansible cible1 -m ping
      13    ansible cible2 -m ping
      14    ansible 146.59.158.16 -m ping
      15    ansible 141.95.160.133 -m ping
      16    sudo touch cible1.txt
      17    ansible cible1 -m copy -a "src=cible1.txt dest=/tmp"
      18    ansible cible1 -m ls -a "dest=/tmp"
      19    ansible cible1 -m shell -a "ls -lrt /tmp"
      20    ansible cible1 -m file -a "dest=/tmp/cible1.txt mode=777"
      21    ansible cible1 -m user -a "name=cible1 state=present"
      22    ansible cible1 -b -m user -a "name=cible1 state=present"
      23    ansible cible1 -m shell -a "cat /etc/passwd | grep cible1"
      24    ansible all -b -m apt -a "name=curl state=latest"
      25    ansible cible1 -m service -a "name=cron state=started"
      26    ansible cible1 -b -m service -a "name=cron state=started"
      27    ansible cible1 -b -m service -a "name=cron state=stopped"
      28    ansible cible1 -b -m systemd -a "name=cron state=started"
      29    ansible cible1 -b -m systemd -a "name=cron state=stopped"
      30    ansible cible1 -b -m systemd -a "name=cron state=restarted"
      31    ansible all -a 'whoami'
      32    ansible cible1 -a 'whoami'
      33    ansible cible2 -a 'whoami'
      34    ansible all -ab 'whoami'
      35    ansible all -b -a 'whoami'
      36    ansible all -ba 'whoami'
      37    sudo vim nginx.yaml
      38    ansible-playbook nginx.yml
      39    ansible-playbook nginx.yaml
      40    sudo vim nginx.yaml
      41    ansible all -m service -a "name=apache2 state=status"
      42    ansible cible1 -bm shell -a "systemctl status cron"
      43    uname -a
      44    uname -r
      45    cat /etc/os-release
      46    lsb_release
      47    ansible all -a "cat /ho
      48    sudo vim shell.yml
      49    ansible all -a "cat /home/ansadmin/resultat.txt"
      50    ansible-playbook resultat.txt
      51    sudo vim shell.yml
      52    ansible-playbook /home/ansadmin/resultat.txt
      53    sudo vim shell.yml
      54    ansible-playbook shell.yml
      55    ansible all -a "cat /home/ansadmin/resultat.txt"
      56    sudo vim shell.yml
      57    ansible-playbook shell.yml
      58    sudo vim shell.yml
      59    ansible-playbook shell.yml
      60    sudo vim shell.yml
      61    ansible-playbook shell.yml
      62    ansible-playbook -b shell.yml
      63    ansible all -a "cat /home/ansadmin/resultat.txt"
      64    sudo vim handler.yaml
      65    sudo vim handler.yaml
      66    vim handler.yaml
      67    sudo vim when.yml
      68    history
ansadmin@svl200:~$ ls
cible1.txt    debug1.yaml    fact1.yaml        index.html    nginx.yaml    when.yaml
debug.yaml    fact.yaml        handler.yaml    ip.txt            shell.yml
ansadmin@svl200:~$ sudo vim debug1.yaml
ansadmin@svl200:~$ ansible-playbook -b debug1.yaml

PLAY [debug]
*******************************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]

TASK [show results]


************************************************************************
ok: [146.59.158.16] => {
        "msg": "Le serveur Apache utilise par defaut le port 80 sur ma machine
Debian"
}

PLAY RECAP
*********************************************************************************
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim when.yaml


ansadmin@svl200:~$ ansible-playbook when.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


*************************************************************
fatal: [146.59.158.16]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time"        664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg:        tions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' faile        E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'httpd        as no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation ca        date"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state info        tion...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n          inx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20.     
1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    webf        .21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-h        d 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree...       
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx-        ht 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3",          lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ubu        3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigenser         
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
...ignoring
fatal: [141.95.160.133]: FAILED! => {"ansible_facts": {"pkg_mgr": "apt"},
"cache_update_time        1664804313, "cache_updated": false, "changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg        ptions::=--force-confdef\" -
o \"Dpkg::Options::=--force-confold\"            install 'httpd'' fail          E:
Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package
'http        has no installation candidate\n", "stderr_lines": ["E: Package 'httpd'
has no installation c        idate"], "stdout": "Reading package lists...\nBuilding
dependency tree...\nReading state inf        ation...\nPackage httpd is a virtual
package provided by:\n    nginx-light 1.18.0-0ubuntu1.3\n        ginx-full 1.18.0-
0ubuntu1.3\n    nginx-extras 1.18.0-0ubuntu1.3\n    lighttpd 1.4.55-1ubuntu1.20     
.1\n    nginx-core 1.18.0-0ubuntu1.3\n    apache2 2.4.41-4ubuntu3.12\n    yaws
2.0.7+dfsg-1\n    web        1.21+ds1-12\n    tntnet 2.2.1-4build1\n    ocsigenserver
2.16.0-2\n    mini-httpd 1.30-2\n    micro-        pd 20140814-2\n\n",
"stdout_lines": ["Reading package lists...", "Building dependency tree..         
"Reading state information...", "Package httpd is a virtual package provided by:", " 
nginx        ght 1.18.0-0ubuntu1.3", "    nginx-full 1.18.0-0ubuntu1.3", "    nginx-
extras 1.18.0-0ubuntu1.3"            lighttpd 1.4.55-1ubuntu1.20.04.1", "    nginx-
core 1.18.0-0ubuntu1.3", "    apache2 2.4.41-4ub        u3.12", "    yaws 2.0.7+dfsg-
1", "    webfs 1.21+ds1-12", "    tntnet 2.2.1-4build1", "    ocsigense        r
2.16.0-2", "    mini-httpd 1.30-2", "    micro-httpd 20140814-2", ""]}
...ignoring

TASK [install apache2 on ubuntu]


***********************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=3        changed=0        unreachable=0 
failed=0        skipped=0                cued=0        ignored=1
146.59.158.16                            : ok=3        changed=0        unreachable=0
failed=0        skipped=0                cued=0        ignored=1

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$ sudo rm when1.yaml
rm: cannot remove 'when1.yaml': No such file or directory
ansadmin@svl200:~$ sudo rm -f when1.yaml
ansadmin@svl200:~$ ls
cible1.txt    debug1.yaml    fact1.yaml        index.html    nginx.yaml    when.yaml
debug.yaml    fact.yaml        handler.yaml    ip.txt            shell.yml
ansadmin@svl200:~$ sudo cp when.yaml when1.yaml
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$ ansible-playbook when1.yaml

PLAY [exemple avec condition when]


*********************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


*************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [install apache2 on ubuntu]


***********************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=1                cued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=1                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim list.yaml


ansadmin@svl200:~$ ansible-playbook list.yaml
PLAY [exemple ansible list]
****************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install package]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ ansible-playbook items.yaml

PLAY [exemple avec items]


******************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


******************************************************
changed: [146.59.158.16] => (item=init1.txt)
changed: [141.95.160.133] => (item=init1.txt)
changed: [146.59.158.16] => (item=init2.txt)
changed: [141.95.160.133] => (item=init2.txt)
changed: [146.59.158.16] => (item=init3.txt)
changed: [141.95.160.133] => (item=init3.txt)
changed: [146.59.158.16] => (item=init4.txt)
changed: [141.95.160.133] => (item=init4.txt)

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ ls
cible1.txt    debug1.yaml    fact1.yaml        index.html    items.yaml    nginx.yaml
when.yaml
debug.yaml    fact.yaml        handler.yaml    ip.txt            list.yaml     
shell.yml      when1.yaml
ansadmin@svl200:~$ ansible cible1 -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible cible1 -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible cible2 -bm shell -a "ls -lrt /home/ansadmin"
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$ ansible all -bma "ls -lrt /home/ansadmin"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: unrecognized arguments: ls -lrt /home/ansadmin
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ cp items.yaml seq.yaml
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ ansible-playbook seq.yaml

PLAY [exemple avec items]


******************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [creation de liste des fichiers]
******************************************************
changed: [146.59.158.16] => (item=20)
changed: [141.95.160.133] => (item=20)
changed: [146.59.158.16] => (item=21)
changed: [141.95.160.133] => (item=21)
changed: [146.59.158.16] => (item=22)
changed: [141.95.160.133] => (item=22)
changed: [146.59.158.16] => (item=23)
changed: [141.95.160.133] => (item=23)
changed: [146.59.158.16] => (item=24)
changed: [141.95.160.133] => (item=24)
changed: [146.59.158.16] => (item=25)
changed: [141.95.160.133] => (item=25)
changed: [146.59.158.16] => (item=26)
changed: [141.95.160.133] => (item=26)
changed: [146.59.158.16] => (item=27)
changed: [141.95.160.133] => (item=27)

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"


146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:14 init4.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
───────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Mon Oct    3 17:50:31 2022 from 80.119.120.22
ofi03@svl200:~$
ofi03@svl200:~$ ansible all -bm group -a "name=rennes"
The authenticity of host '[146.59.158.16]:55600 ([146.59.158.16]:55600)' can't be
establishe
ECDSA key fingerprint is SHA256:aQH+1UeVJklKq8A45Soa63iOGGkNRC/op7o5MgPiJtc.
The authenticity of host '[141.95.160.133]:55600 ([141.95.160.133]:55600)' can't be
establis
ECDSA key fingerprint is SHA256:XtY+kTiWN4Ohe3xBY3YAQ9YLSSuP7bbmxZjN/R9SBcs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
146.59.158.16 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: Warning: Permanently added
'[146.59.158.1        ickey,password).",
        "unreachable": true
}
^C [ERROR]: User interrupted execution
ofi03@svl200:~$
ofi03@svl200:~$ ansible all -bm group -a "name=rennes"
The authenticity of host '[141.95.160.133]:55600 ([141.95.160.133]:55600)' can't be
establis
ECDSA key fingerprint is SHA256:XtY+kTiWN4Ohe3xBY3YAQ9YLSSuP7bbmxZjN/R9SBcs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 146.59.158.16 |
UNREACH
        "changed": false,
        "msg": "Failed to connect to the host via ssh: ofi03@146.59.158.16:
Permission denied (p
        "unreachable": true
}
yes
141.95.160.133 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: Warning: Permanently added
'[141.95.160.1        blickey,password).",
        "unreachable": true
}
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm group -a "name=rennes"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1008,
        "name": "rennes",
        "state": "present",
        "system": false
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1004,
        "name": "rennes",
        "state": "present",
        "system": false
}
ansadmin@svl200:~$ ansible all -bm group -a "name=lille"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1009,
        "name": "lille",
        "state": "present",
        "system": false
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1005,
        "name": "lille",
        "state": "present",
        "system": false
}
ansadmin@svl200:~$ ansible all -bm group -a "name=paris"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1010,
        "name": "paris",
        "state": "present",
        "system": false
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1006,
        "name": "paris",
        "state": "present",
        "system": false
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm user -a "name=core"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "comment": "",
        "create_home": true,
        "group": 1011,
        "home": "/home/core",
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "system": false,
        "uid": 1008
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "comment": "",
        "create_home": true,
        "group": 1007,
        "home": "/home/core",
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "system": false,
        "uid": 1004
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm user -a "name=core uid=10000"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1011,
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1007,
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm user -a "name=core groups=rennes"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1011,
        "groups": "rennes",
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "append": false,
        "changed": true,
        "comment": "",
        "group": 1007,
        "groups": "rennes",
        "home": "/home/core",
        "move_home": false,
        "name": "core",
        "shell": "/bin/sh",
        "state": "present",
        "uid": 10000
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm apt -a "name=tree state=latest"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "cache_update_time": 1664843277,
        "cache_updated": false,
        "changed": true,
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state informat          0 to remove and 0 not upgraded.\nNeed to get 43.0 kB of
archives.\nAfter this operation, 11        tu focal/universe amd64 tree amd64 1.8.0-1
[43.0 kB]\nFetched 43.0 kB in 0s (133 kB/s)\nSele        \r(Reading database ... 10%\
r(Reading database ... 15%\r(Reading database ... 20%\r(Reading            40%\
r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\
r(Read          ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\
r(Reading database ... 90%\r(        irectories currently installed.)\r\nPreparing to
unpack .../tree_1.8.0-1_amd64.deb ...\r\nUn          (2.9.1-1) ...\r\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "The following NEW packages will be installed:",
                "    tree",
                "0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.",
                "Need to get 43.0 kB of archives.",
                "After this operation, 115 kB of additional disk space will be
used.",
                "Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu focal/universe
amd64 tree amd64
                "Fetched 43.0 kB in 0s (133 kB/s)",
                "Selecting previously unselected package tree.",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97568 files and directories currently
installed.)",
                "Preparing to unpack .../tree_1.8.0-1_amd64.deb ...",
                "Unpacking tree (1.8.0-1) ...",
                "Setting up tree (1.8.0-1) ...",
                "Processing triggers for man-db (2.9.1-1) ..."
        ]
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "cache_update_time": 1664804313,
        "cache_updated": false,
        "changed": true,
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state informat          0 to remove and 18 not upgraded.\nNeed to get 43.0 kB of
archives.\nAfter this operation, 1        ntu focal/universe amd64 tree amd64 1.8.0-1
[43.0 kB]\nFetched 43.0 kB in 0s (129 kB/s)\nSel        %\r(Reading database ... 10%\
r(Reading database ... 15%\r(Reading database ... 20%\r(Reading        . 40%\
r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\
r(Rea        e ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\
r(Reading database ... 90%\r        directories currently installed.)\r\nPreparing to
unpack .../tree_1.8.0-1_amd64.deb ...\r\nU        b (2.9.1-1) ...\r\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "The following NEW packages will be installed:",
                "    tree",
                "0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.",
                "Need to get 43.0 kB of archives.",
                "After this operation, 115 kB of additional disk space will be
used.",
                "Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu focal/universe
amd64 tree amd64
                "Fetched 43.0 kB in 0s (129 kB/s)",
                "Selecting previously unselected package tree.",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97537 files and directories currently
installed.)",
                "Preparing to unpack .../tree_1.8.0-1_amd64.deb ...",
                "Unpacking tree (1.8.0-1) ...",
                "Setting up tree (1.8.0-1) ...",
                "Processing triggers for man-db (2.9.1-1) ..."
        ]
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm service -a "name=cron state=stopped"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "cron",
        "state": "stopped",
        "status": {
                "ActiveEnterTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ActiveEnterTimestampMonotonic": "3297087651422",
                "ActiveExitTimestamp": "Mon 2022-10-03 12:11:21 UTC",
                "ActiveExitTimestampMonotonic": "3297037132653",
                "ActiveState": "active",
                "After": "nss-user-lookup.target system.slice systemd-journald.socket
remote-fs.targ
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "AssertTimestampMonotonic": "3297087645970",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner          e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_          cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_au        spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ConditionTimestampMonotonic": "3297087645969",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlGroup": "/system.slice/cron.service",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "0",
                "ExecMainExitTimestampMonotonic": "0",
                "ExecMainPID": "253639",
                "ExecMainStartTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ExecMainStartTimestampMonotonic": "3297087647720",
                "ExecMainStatus": "0",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestamp": "Mon 2022-10-03 12:11:21 UTC",
                "InactiveEnterTimestampMonotonic": "3297037133883",
                "InactiveExitTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "InactiveExitTimestampMonotonic": "3297087651422",
                "InvocationID": "1146685551e74a078e22588cc853b8b0",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "253639",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "2965504",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "system.slice sysinit.target",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "StateChangeTimestampMonotonic": "3297087651422",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "running",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "1",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "cron",
        "state": "stopped",
        "status": {
                "ActiveEnterTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ActiveEnterTimestampMonotonic": "15934843",
                "ActiveExitTimestampMonotonic": "0",
                "ActiveState": "active",
                "After": "nss-user-lookup.target basic.target sysinit.target systemd-
journald.socket
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "AssertTimestampMonotonic": "15930137",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner          e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_          cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_au        spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ConditionTimestampMonotonic": "15930135",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlGroup": "/system.slice/cron.service",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "0",
                "ExecMainExitTimestampMonotonic": "0",
                "ExecMainPID": "679",
                "ExecMainStartTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ExecMainStartTimestampMonotonic": "15934762",
                "ExecMainStatus": "0",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestampMonotonic": "0",
                "InactiveExitTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "InactiveExitTimestampMonotonic": "15934843",
                "InvocationID": "dcee66e33a3a4a47a8ce4148d9734e2f",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "679",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "6848512",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "sysinit.target system.slice",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "StateChangeTimestampMonotonic": "15934843",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "running",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "1",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm service -a "name=cron state=disabled"
146.59.158.16 | FAILED! => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "value of state must be one of: reloaded, restarted, started, stopped,
got: disab
}
141.95.160.133 | FAILED! => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "value of state must be one of: reloaded, restarted, started, stopped,
got: disab
}
ansadmin@svl200:~$ ansible all -bm service -a "name=cron enabled=no"
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "enabled": false,
        "name": "cron",
        "status": {
                "ActiveEnterTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ActiveEnterTimestampMonotonic": "15934843",
                "ActiveExitTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "ActiveExitTimestampMonotonic": "1719968363076",
                "ActiveState": "inactive",
                "After": "nss-user-lookup.target basic.target sysinit.target systemd-
journald.socket
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "AssertTimestampMonotonic": "15930137",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner          e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_          cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_au        spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ConditionTimestampMonotonic": "15930135",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "2",
                "ExecMainExitTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "ExecMainExitTimestampMonotonic": "1719968363869",
                "ExecMainPID": "679",
                "ExecMainStartTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "ExecMainStartTimestampMonotonic": "15934762",
                "ExecMainStatus": "15",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_        ] ; pid=679 ; code=killed ; status=15/TERM }",
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags        679 ; code=killed ; status=15/TERM }",
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "InactiveEnterTimestampMonotonic": "1719968363887",
                "InactiveExitTimestamp": "Wed 2022-09-14 10:23:26 UTC",
                "InactiveExitTimestampMonotonic": "15934843",
                "InvocationID": "dcee66e33a3a4a47a8ce4148d9734e2f",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "0",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "[not set]",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "sysinit.target system.slice",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Tue 2022-10-04 08:09:19 UTC",
                "StateChangeTimestampMonotonic": "1719968363887",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "dead",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "[not set]",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "enabled": false,
        "name": "cron",
        "status": {
                "ActiveEnterTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ActiveEnterTimestampMonotonic": "3297087651422",
                "ActiveExitTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "ActiveExitTimestampMonotonic": "3368914737265",
                "ActiveState": "inactive",
                "After": "nss-user-lookup.target system.slice systemd-journald.socket
remote-fs.targ
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "AssertTimestampMonotonic": "3297087645970",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "no",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_fowner          e cap_net_broadcast cap_net_admin cap_net_raw
cap_ipc_lock cap_ipc_owner cap_sys_module cap_          cap_sys_resource cap_sys_time
cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_au        spend
cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ConditionTimestampMonotonic": "3297087645969",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "Regular background program processing daemon",
                "DevicePolicy": "auto",
                "Documentation": "man:cron(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "EnvironmentFiles": "/etc/default/cron (ignore_errors=yes)",
                "ExecMainCode": "2",
                "ExecMainExitTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "ExecMainExitTimestampMonotonic": "3368914738115",
                "ExecMainPID": "253639",
                "ExecMainStartTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "ExecMainStartTimestampMonotonic": "3297087647720",
                "ExecMainStatus": "15",
                "ExecStart": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; ignore_        ] ; pid=253639 ; code=killed ; status=15/TERM }",
                "ExecStartEx": "{ path=/usr/sbin/cron ; argv[]=/usr/sbin/cron -f
$EXTRA_OPTS ; flags        253639 ; code=killed ; status=15/TERM }",
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/cron.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "cron.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "no",
                "InactiveEnterTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "InactiveEnterTimestampMonotonic": "3368914738600",
                "InactiveExitTimestamp": "Mon 2022-10-03 12:12:11 UTC",
                "InactiveExitTimestampMonotonic": "3297087651422",
                "InvocationID": "1146685551e74a078e22588cc853b8b0",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "process",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "0",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "[not set]",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "cron.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "system.slice sysinit.target",
                "Restart": "on-failure",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Tue 2022-10-04 08:09:18 UTC",
                "StateChangeTimestampMonotonic": "3368914738600",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "dead",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "[not set]",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "1min 30s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "1min 30s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "simple",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -m file -a "path=/tmp/test.txt state=touch mode=0644"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "dest": "/tmp/test.txt",
        "gid": 1006,
        "group": "ansadmin",
        "mode": "0644",
        "owner": "ansadmin",
        "size": 0,
        "state": "file",
        "uid": 1006
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "dest": "/tmp/test.txt",
        "gid": 1003,
        "group": "ansadmin",
        "mode": "0644",
        "owner": "ansadmin",
        "size": 0,
        "state": "file",
        "uid": 1003
}
ansadmin@svl200:~$ ansible all -m shell -a "ls -lrt /tmp/test.txt | grep test"
141.95.160.133 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin 0 Oct    4 08:16 /tmp/test.txt
146.59.158.16 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin 0 Oct    4 08:16 /tmp/test.txt
ansadmin@svl200:~$ ansible all -m shell -a "ls -lrt /tmp | grep test"
146.59.158.16 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
141.95.160.133 | CHANGED | rc=0 >>
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -m directory -a "path=/tmp/dir state= mode=755"
146.59.158.16 | FAILED! => {
        "msg": "The module directory was not found in configured module paths"
}
141.95.160.133 | FAILED! => {
        "msg": "The module directory was not found in configured module paths"
}
ansadmin@svl200:~$ ansible all -m dir -a "path=/tmp/dir state= mode=755"
141.95.160.133 | FAILED! => {
        "msg": "The module dir was not found in configured module paths"
}
146.59.158.16 | FAILED! => {
        "msg": "The module dir was not found in configured module paths"
}
ansadmin@svl200:~$ ansible all -m file -a "path=/tmp/dir state=directory    mode=755"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1006,
        "group": "ansadmin",
        "mode": "0755",
        "owner": "ansadmin",
        "path": "/tmp/dir",
        "size": 4096,
        "state": "directory",
        "uid": 1006
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "gid": 1003,
        "group": "ansadmin",
        "mode": "0755",
        "owner": "ansadmin",
        "path": "/tmp/dir",
        "size": 4096,
        "state": "directory",
        "uid": 1003
}
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm apt -a "name=* state=latest"
146.59.158.16 | SUCCESS => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "Reading package lists...\nBuilding dependency tree...\nReading state
information        ",
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state informat        .\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "Calculating upgrade...",
                "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."
        ]
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "msg": "Reading package lists...\nBuilding dependency tree...\nReading state
information        n0 libnss-systemd libpam-systemd libsystemd0\n    libtss2-esys0
libudev1 motd-news-config netp        syncd\n    ubuntu-advantage-tools ubuntu-
release-upgrader-core udev\n18 upgraded, 0 newly inst        n, 2594 kB disk space
will be freed.\nGet:1 http://nova.clouds.archive.ubuntu.com/ubuntu foc       
hive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.6 [60.4
kB]\nGet:        245.4-4ubuntu3.18 [96.1 kB]\nGet:4
http://nova.clouds.archive.ubuntu.com/ubuntu focal-update        com/ubuntu focal-
updates/main amd64 libudev1 amd64 245.4-4ubuntu3.18 [76.3 kB]\nGet:6 http:/       
ntu3.18 [10.3 kB]\nGet:7 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd        tu.com/ubuntu focal-updates/main amd64 libpam-systemd
amd64 245.4-4ubuntu3.18 [186 kB]\nGet:        ubuntu3.18 [3808 kB]\nGet:10
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main        .com/ubuntu
focal-updates/main amd64 netplan.io amd64 0.104-0ubuntu2~20.04.2 [88.0 kB]\nGet:     
104-0ubuntu2~20.04.2 [82.5 kB]\nGet:13 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-up        uds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-apt
amd64 2.0.0ubuntu0.20.04.        tu-advantage-tools amd64 27.10.1~20.04.1 [146 kB]\
nGet:16 http://nova.clouds.archive.ubuntu.        t:17
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-
distupgra        /main amd64 libtss2-esys0 amd64 2.3.2-1ubuntu0.20.04.1 [226 kB]\
nPreconfiguring packages ...        ng database ... 10%\r(Reading database ... 15%\
r(Reading database ... 20%\r(Reading database        eading database ... 45%\
r(Reading database ... 50%\r(Reading database ... 55%\r(Reading data        \
r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\
r(Reading          es currently installed.)\r\nPreparing to unpack .../motd-news-
config_11ubuntu5.6_all.deb ...        ./base-files_11ubuntu5.6_amd64.deb ...\r\
nWarning: Stopping motd-news.service, but it can st        u5.5) ...\r\nSetting up
base-files (11ubuntu5.6) ...\r\nInstalling new version of config fil        w version
of config file /etc/lsb-release ...\r\nmotd-news.service is a disabled or a static   
e ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading
database ... 25%\r        abase ... 45%\r(Reading database ... 50%\r(Reading database
... 55%\r(Reading database ... 6          database ... 80%\r(Reading database ...
85%\r(Reading database ... 90%\r(Reading database .        ly installed.)\r\
nPreparing to unpack .../libnss-systemd_245.4-4ubuntu3.18_amd64.deb ...\r\n        to
unpack .../udev_245.4-4ubuntu3.18_amd64.deb ...\r\nUnpacking udev (245.4-4ubuntu3.18)
ove        \r\nUnpacking libudev1:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...\r\nSetting up          Reading database ... 10%\r(Reading
database ... 15%\r(Reading database ... 20%\r(Reading dat        %\r(Reading database
... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading        . 75%\
r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\
r(Rea        ctories currently installed.)\r\nPreparing to unpack .../systemd-
sysv_245.4-4ubuntu3.18_amd6        ring to unpack .../systemd-timesyncd_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpacking systemd-ti        stemd_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpacking libpam-systemd:amd64 (245.4-4ubuntu3.18)     
..\r\nUnpacking systemd (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...\r\nPreparing
to unp        untu3.18) over (245.4-4ubuntu3.17) ...\r\nSetting up libsystemd0:amd64
(245.4-4ubuntu3.18) .        atabase ... 15%\r(Reading database ... 20%\r(Reading
database ... 25%\r(Reading database ...        ng database ... 50%\r(Reading database
... 55%\r(Reading database ... 60%\r(Reading database        eading database ... 85%\
r(Reading database ... 90%\r(Reading database ... 95%\r(Reading data        paring to
unpack .../0-netplan.io_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\nUnpacking netplan.   
bnetplan0_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\nUnpacking libnetplan0:amd64 (0.104-
0ubuntu        .0.0ubuntu0.20.04.8_all.deb ...\r\nUnpacking python-apt-common
(2.0.0ubuntu0.20.04.8) over (        .deb ...\r\nUnpacking python3-apt
(2.0.0ubuntu0.20.04.8) over (2.0.0ubuntu0.20.04.7) ...\r\n        buntu-advantage-
tools (27.10.1~20.04.1) over (27.9~20.04.1) ...\r\nPreparing to unpack .../5       
ore (1:20.04.39) over (1:20.04.38) ...\r\nPreparing to unpack .../6-python3-
distupgrade_1%3a        reparing to unpack .../7-libtss2-esys0_2.3.2-
1ubuntu0.20.04.1_amd64.deb ...\r\nUnpacking lib        tu5.6) ...\r\nSetting up
libtss2-esys0 (2.3.2-1ubuntu0.20.04.1) ...\r\nSetting up libnetplan        tramfs:
deferring update (trigger activated)\r\nSetting up python-apt-common (2.0.0ubuntu0.2 
grade (1:20.04.39) ...\r\nSetting up ubuntu-release-upgrader-core (1:20.04.39) ...\r\
nSettin        ..\r\nSetting up netplan.io (0.104-0ubuntu2~20.04.2) ...\r\nSetting up
systemd-timesyncd (24        systemd:amd64 (245.4-4ubuntu3.18) ...\r\nSetting up
libpam-systemd:amd64 (245.4-4ubuntu3.18)        libc-bin (2.31-0ubuntu9.9) ...\r\
nProcessing triggers for man-db (2.9.1-1) ...\r\nProcessing        s: deferring
update (trigger activated)\r\nProcessing triggers for dbus (1.12.16-2ubuntu2.2)     
erating /boot/initrd.img-5.4.0-126-generic\r\n",
        "stderr": "",
        "stderr_lines": [],
        "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
state informat        plan0 libnss-systemd libpam-systemd libsystemd0\n    libtss2-
esys0 libudev1 motd-news-config n        imesyncd\n    ubuntu-advantage-tools ubuntu-
release-upgrader-core udev\n18 upgraded, 0 newly i        tion, 2594 kB disk space
will be freed.\nGet:1 http://nova.clouds.archive.ubuntu.com/ubuntu         
archive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.6 [60.4
kB]\nG        64 245.4-4ubuntu3.18 [96.1 kB]\nGet:4
http://nova.clouds.archive.ubuntu.com/ubuntu focal-upd        tu.com/ubuntu focal-
updates/main amd64 libudev1 amd64 245.4-4ubuntu3.18 [76.3 kB]\nGet:6 htt       
ubuntu3.18 [10.3 kB]\nGet:7 http://nova.clouds.archive.ubuntu.com/ubuntu focal-
updates/main          buntu.com/ubuntu focal-updates/main amd64 libpam-systemd amd64
245.4-4ubuntu3.18 [186 kB]\nG        4-4ubuntu3.18 [3808 kB]\nGet:10
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/m        ntu.com/ubuntu
focal-updates/main amd64 netplan.io amd64 0.104-0ubuntu2~20.04.2 [88.0 kB]\nG       
0.104-0ubuntu2~20.04.2 [82.5 kB]\nGet:13 http://nova.clouds.archive.ubuntu.com/ubuntu
focal        clouds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-apt
amd64 2.0.0ubuntu0.20.        buntu-advantage-tools amd64 27.10.1~20.04.1 [146 kB]\
nGet:16 http://nova.clouds.archive.ubun        nGet:17
http://nova.clouds.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-distup 
tes/main amd64 libtss2-esys0 amd64 2.3.2-1ubuntu0.20.04.1 [226 kB]\nPreconfiguring
packages          ading database ... 10%\r(Reading database ... 15%\r(Reading
database ... 20%\r(Reading datab        r(Reading database ... 45%\r(Reading database
... 50%\r(Reading database ... 55%\r(Reading d        75%\r(Reading database ... 80%\
r(Reading database ... 85%\r(Reading database ... 90%\r(Readi        ories currently
installed.)\r\nPreparing to unpack .../motd-news-config_11ubuntu5.6_all.deb         
.../base-files_11ubuntu5.6_amd64.deb ...\r\nWarning: Stopping motd-news.service, but
it can        untu5.5) ...\r\nSetting up base-files (11ubuntu5.6) ...\r\nInstalling
new version of config            new version of config file /etc/lsb-release ...\r\
nmotd-news.service is a disabled or a sta        base ... 10%\r(Reading database ...
15%\r(Reading database ... 20%\r(Reading database ... 25        database ... 45%\
r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ..       
ing database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading
databas        ently installed.)\r\nPreparing to unpack .../libnss-systemd_245.4-
4ubuntu3.18_amd64.deb ...\        ng to unpack .../udev_245.4-
4ubuntu3.18_amd64.deb ...\r\nUnpacking udev (245.4-4ubuntu3.18)          ...\r\
nUnpacking libudev1:amd64 (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...\r\nSetting
\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\
r(Reading            40%\r(Reading database ... 45%\r(Reading database ... 50%\
r(Reading database ... 55%\r(Read          ... 75%\r(Reading database ... 80%\
r(Reading database ... 85%\r(Reading database ... 90%\r(        irectories currently
installed.)\r\nPreparing to unpack .../systemd-sysv_245.4-4ubuntu3.18_a       
eparing to unpack .../systemd-timesyncd_245.4-4ubuntu3.18_amd64.deb ...\r\nUnpacking
systemd        -systemd_245.4-4ubuntu3.18_amd64.deb ...\r\nUnpacking libpam-
systemd:amd64 (245.4-4ubuntu3.1        b ...\r\nUnpacking systemd (245.4-4ubuntu3.18)
over (245.4-4ubuntu3.17) ...\r\nPreparing to          4ubuntu3.18) over (245.4-
4ubuntu3.17) ...\r\nSetting up libsystemd0:amd64 (245.4-4ubuntu3.18        g database
... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database     
ading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\
r(Reading datab        r(Reading database ... 85%\r(Reading database ... 90%\
r(Reading database ... 95%\r(Reading d        Preparing to unpack .../0-
netplan.io_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\nUnpacking netpl        -
libnetplan0_0.104-0ubuntu2~20.04.2_amd64.deb ...\r\nUnpacking libnetplan0:amd64
(0.104-0ubu        n_2.0.0ubuntu0.20.04.8_all.deb ...\r\nUnpacking python-apt-common
(2.0.0ubuntu0.20.04.8) ove        d64.deb ...\r\nUnpacking python3-apt
(2.0.0ubuntu0.20.04.8) over (2.0.0ubuntu0.20.04.7) ...\        g ubuntu-advantage-
tools (27.10.1~20.04.1) over (27.9~20.04.1) ...\r\nPreparing to unpack ..        r-
core (1:20.04.39) over (1:20.04.38) ...\r\nPreparing to unpack .../6-python3-
distupgrade_1        \nPreparing to unpack .../7-libtss2-esys0_2.3.2-
1ubuntu0.20.04.1_amd64.deb ...\r\nUnpacking          buntu5.6) ...\r\nSetting up
libtss2-esys0 (2.3.2-1ubuntu0.20.04.1) ...\r\nSetting up libnetp        initramfs:
deferring update (trigger activated)\r\nSetting up python-apt-common (2.0.0ubuntu   
tupgrade (1:20.04.39) ...\r\nSetting up ubuntu-release-upgrader-core
(1:20.04.39) ...\r\nSet        ) ...\r\nSetting up netplan.io (0.104-
0ubuntu2~20.04.2) ...\r\nSetting up systemd-timesyncd          ss-systemd:amd64
(245.4-4ubuntu3.18) ...\r\nSetting up libpam-systemd:amd64 (245.4-4ubuntu3.        or
libc-bin (2.31-0ubuntu9.9) ...\r\nProcessing triggers for man-db (2.9.1-1) ...\r\
nProcess        amfs: deferring update (trigger activated)\r\nProcessing triggers for
dbus (1.12.16-2ubuntu2        Generating /boot/initrd.img-5.4.0-126-generic\r\n",
        "stdout_lines": [
                "Reading package lists...",
                "Building dependency tree...",
                "Reading state information...",
                "Calculating upgrade...",
                "The following packages will be upgraded:",
                "    base-files libnetplan0 libnss-systemd libpam-systemd
libsystemd0",
                "    libtss2-esys0 libudev1 motd-news-config netplan.io python-apt-
common",
                "    python3-apt python3-distupgrade systemd systemd-sysv systemd-
timesyncd",
                "    ubuntu-advantage-tools ubuntu-release-upgrader-core udev",
                "18 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.",
                "Need to get 6747 kB of archives.",
                "After this operation, 2594 kB disk space will be freed.",
                "Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 motd-ne
                "Get:2 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 base-fi
                "Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libnss-
                "Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 udev am
                "Get:5 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libudev
                "Get:6 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 systemd
                "Get:7 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 systemd
                "Get:8 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libpam-
                "Get:9 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 systemd
                "Get:10 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libsys
                "Get:11 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 netpla
                "Get:12 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libnet
                "Get:13 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 python
                "Get:14 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 python
                "Get:15 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 ubuntu
                "Get:16 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 ubuntu
                "Get:17 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 python
                "Get:18 http://nova.clouds.archive.ubuntu.com/ubuntu
focal-updates/main amd64 libtss
                "Preconfiguring packages ...",
                "Fetched 6747 kB in 1s (6785 kB/s)",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../motd-news-config_11ubuntu5.6_all.deb ...",
                "Unpacking motd-news-config (11ubuntu5.6) over (11ubuntu5.5) ...",
                "Preparing to unpack .../base-files_11ubuntu5.6_amd64.deb ...",
                "Warning: Stopping motd-news.service, but it can still be activated
by:",
                "    motd-news.timer",
                "Unpacking base-files (11ubuntu5.6) over (11ubuntu5.5) ...",
                "Setting up base-files (11ubuntu5.6) ...",
                "Installing new version of config file /etc/issue ...",
                "Installing new version of config file /etc/issue.net ...",
                "Installing new version of config file /etc/lsb-release ...",
                "motd-news.service is a disabled or a static unit, not starting it.",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../libnss-systemd_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking libnss-systemd:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../udev_245.4-4ubuntu3.18_amd64.deb ...",
                "Unpacking udev (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...",
                "Preparing to unpack .../libudev1_245.4-4ubuntu3.18_amd64.deb ...",
                "Unpacking libudev1:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Setting up libudev1:amd64 (245.4-4ubuntu3.18) ...",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../systemd-sysv_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking systemd-sysv (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../systemd-timesyncd_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking systemd-timesyncd (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../libpam-systemd_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking libpam-systemd:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Preparing to unpack .../systemd_245.4-4ubuntu3.18_amd64.deb ...",
                "Unpacking systemd (245.4-4ubuntu3.18) over (245.4-4ubuntu3.17) ...",
                "Preparing to unpack .../libsystemd0_245.4-
4ubuntu3.18_amd64.deb ...",
                "Unpacking libsystemd0:amd64 (245.4-4ubuntu3.18) over (245.4-
4ubuntu3.17) ...",
                "Setting up libsystemd0:amd64 (245.4-4ubuntu3.18) ...",
                "(Reading database ... ",
                "(Reading database ... 5%",
                "(Reading database ... 10%",
                "(Reading database ... 15%",
                "(Reading database ... 20%",
                "(Reading database ... 25%",
                "(Reading database ... 30%",
                "(Reading database ... 35%",
                "(Reading database ... 40%",
                "(Reading database ... 45%",
                "(Reading database ... 50%",
                "(Reading database ... 55%",
                "(Reading database ... 60%",
                "(Reading database ... 65%",
                "(Reading database ... 70%",
                "(Reading database ... 75%",
                "(Reading database ... 80%",
                "(Reading database ... 85%",
                "(Reading database ... 90%",
                "(Reading database ... 95%",
                "(Reading database ... 100%",
                "(Reading database ... 97544 files and directories currently
installed.)",
                "Preparing to unpack .../0-netplan.io_0.104-
0ubuntu2~20.04.2_amd64.deb ...",
                "Unpacking netplan.io (0.104-0ubuntu2~20.04.2) over (0.104-
0ubuntu2~20.04.1) ...",
                "Preparing to unpack .../1-libnetplan0_0.104-
0ubuntu2~20.04.2_amd64.deb ...",
                "Unpacking libnetplan0:amd64 (0.104-0ubuntu2~20.04.2) over (0.104-
0ubuntu2~20.04.1)
                "Preparing to unpack .../2-python-apt-
common_2.0.0ubuntu0.20.04.8_all.deb ...",
                "Unpacking python-apt-common (2.0.0ubuntu0.20.04.8) over
(2.0.0ubuntu0.20.04.7) ..."
                "Preparing to unpack .../3-python3-apt_2.0.0ubuntu0.20.04.8_amd64.deb
...",
                "Unpacking python3-apt (2.0.0ubuntu0.20.04.8) over
(2.0.0ubuntu0.20.04.7) ...",
                "Preparing to unpack .../4-ubuntu-advantage-
tools_27.10.1~20.04.1_amd64.deb ...",
                "Unpacking ubuntu-advantage-tools (27.10.1~20.04.1) over
(27.9~20.04.1) ...",
                "Preparing to unpack .../5-ubuntu-release-upgrader-
core_1%3a20.04.39_all.deb ...",
                "Unpacking ubuntu-release-upgrader-core (1:20.04.39) over
(1:20.04.38) ...",
                "Preparing to unpack .../6-python3-
distupgrade_1%3a20.04.39_all.deb ...",
                "Unpacking python3-distupgrade (1:20.04.39) over (1:20.04.38) ...",
                "Preparing to unpack .../7-libtss2-esys0_2.3.2-
1ubuntu0.20.04.1_amd64.deb ...",
                "Unpacking libtss2-esys0 (2.3.2-1ubuntu0.20.04.1) over (2.3.2-
1) ...",
                "Setting up motd-news-config (11ubuntu5.6) ...",
                "Setting up libtss2-esys0 (2.3.2-1ubuntu0.20.04.1) ...",
                "Setting up libnetplan0:amd64 (0.104-0ubuntu2~20.04.2) ...",
                "Setting up udev (245.4-4ubuntu3.18) ...",
                "update-initramfs: deferring update (trigger activated)",
                "Setting up python-apt-common (2.0.0ubuntu0.20.04.8) ...",
                "Setting up python3-apt (2.0.0ubuntu0.20.04.8) ...",
                "Setting up python3-distupgrade (1:20.04.39) ...",
                "Setting up ubuntu-release-upgrader-core (1:20.04.39) ...",
                "Setting up ubuntu-advantage-tools (27.10.1~20.04.1) ...",
                "Setting up systemd (245.4-4ubuntu3.18) ...",
                "Setting up netplan.io (0.104-0ubuntu2~20.04.2) ...",
                "Setting up systemd-timesyncd (245.4-4ubuntu3.18) ...",
                "Setting up systemd-sysv (245.4-4ubuntu3.18) ...",
                "Setting up libnss-systemd:amd64 (245.4-4ubuntu3.18) ...",
                "Setting up libpam-systemd:amd64 (245.4-4ubuntu3.18) ...",
                "Processing triggers for install-info (6.7.0.dfsg.2-5) ...",
                "Processing triggers for libc-bin (2.31-0ubuntu9.9) ...",
                "Processing triggers for man-db (2.9.1-1) ...",
                "Processing triggers for plymouth-theme-ubuntu-text
(0.9.4git20200323-0ubuntu6.2) ..
                "update-initramfs: deferring update (trigger activated)",
                "Processing triggers for dbus (1.12.16-2ubuntu2.2) ...",
                "Processing triggers for initramfs-tools (0.136ubuntu6.7) ...",
                "update-initramfs: Generating /boot/initrd.img-5.4.0-126-generic"
        ]
}
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo2.yaml
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! conflicting action statements: shell, uid

The error appears to be in '/home/ansadmin/exo3.yaml': line 7, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: utilisateur
            ^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! unexpected parameter type in action: <class 'int'>

The error appears to be in '/home/ansadmin/exo3.yaml': line 7, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: adduser supervision
            ^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! A malformed block was encountered while loading tasks: {'user': [{'name':
'supervisio          'uid': '5000', 'groups': 'rennes'}]} should be a list or None
but is <class 'ansible.parsin        aml.objects.AnsibleMapping'>

The error appears to be in '/home/ansadmin/exo3.yaml': line 2, column 3, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: creation d'utilisateur
    ^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml

PLAY [creation d'utilisateur]


**************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creer user]


**************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ ansible -bm shell -a "id supervision"


usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: the following arguments are required: pattern
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible -bm shell -a "cat /etc/passwd | grep super"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: the following arguments are required: pattern
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible -b -m shell -a "cat /etc/passwd | grep super"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
                              [--become-user BECOME_USER] [-K] [-i INVENTORY] [--
list-hosts] [-l SUBSET]
                              [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
                              [--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER] [-c
CONNECTION] [-T TIMEOUT
                              [--ssh-common-args SSH_COMMON_ARGS] [--sftp-extra-args
SFTP_EXTRA_ARGS]
                              [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-C]
                              [--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                              [--ask-vault-pass | --vault-password-file
VAULT_PASSWORD_FILES] [-f FORKS]
                              [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a
MODULE_ARGS] [-m MODULE_NAME]
                              pattern
ansible: error: the following arguments are required: pattern
ansadmin@svl200:~$ ansible all -b -m shell -a "cat /etc/passwd | grep super"
146.59.158.16 | CHANGED | rc=0 >>
supervision:x:5000:5000::/home/supervision:/bin/sh
141.95.160.133 | CHANGED | rc=0 >>
supervision:x:5000:5000::/home/supervision:/bin/sh
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ cd /etc/ap
apache2/        apparmor/      apparmor.d/ apport/          apt/
ansadmin@svl200:~$
---
- name: Deployer apache
    hosts: cible1
    become: true

    tasks:
        - name: deploiement

Network error: Software caused connection abort


~
─────────────────────────────────────────────────────────────────────────────────────
───────
~
Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
-- INSERT --                                                                         
8,7                      A

Network error: Connection timed out

─────────────────────────────────────────────────────────────────────────────────────
───────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Last login: Tue Oct    4 07:50:40 2022 from 176.160.191.208


ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml
ERROR! conflicting action statements: apt, state

The error appears to be in '/home/ansadmin/exo4.yaml': line 7, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: deploiement
            ^ here
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml

PLAY [Deployer apache]


*********************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]

TASK [deploiement]
*************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'apache' i        vailable"}
PLAY RECAP
*********************************************************************************
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml

PLAY [Deployer apache]


*********************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [deploiement]
*************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'apache' i        vailable"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "No package matching
'apache'          available"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                cued=0        ignored=0

ansadmin@svl200:~$ sudo vim exo4.yaml


ansadmin@svl200:~$ ansible-playbook exo4.yaml

PLAY [Deployer apache]


*********************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [deploiement]
*************************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=0                cued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=0                cued=0        ignored=0
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim when.yaml
ansadmin@svl200:~$ sudo vim when1.yaml
ansadmin@svl200:~$ ansible-playbook when1.yaml

PLAY [exemple avec condition when]


****************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install httpd on centos]


********************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [install apache2 on ubuntu]


******************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=                  1        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=                  1        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim when1.yaml


ansadmin@svl200:~$ sudo vim rep.yaml
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation]
***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation]
***********************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  1        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  1        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim rep.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc"
146.59.158.16 | CHANGED | rc=0 >>
total 884
-rw-r--r-- 1 root root                887 Apr    1    2013 rpc
-rw-r--r-- 1 root root              2932 Apr    1    2013 protocols
-rw-r--r-- 1 root root                280 Jun 20    2014 fuse.conf
-rw-r--r-- 1 root root              3663 Jun 20    2016 screenrc
-rw-r--r-- 1 root root                604 Sep 15    2018 deluser.conf
-rw-r----- 1 root daemon            144 Nov 12    2018 at.deny
-rw-r--r-- 1 root root              1260 Dec 14    2018 ucf.conf
-rw-r--r-- 1 root root                533 Jan 21    2019 logrotate.conf
-rw-r--r-- 1 root root            14867 Feb    1    2019 ltrace.conf
-rw-r--r-- 1 root root              2969 Aug    3    2019 debconf.conf
-rw-r--r-- 1 root root              5060 Aug 21    2019 hdparm.conf
-rw-r--r-- 1 root root                642 Sep 24    2019 xattr.conf
-rw-r--r-- 1 root root            24546 Oct 18    2019 mime.types
-rw-r--r-- 1 root root                449 Oct 18    2019 mailcap.order
-rw-r--r-- 1 root root                581 Dec    5    2019 profile
-rw-r--r-- 1 root root                  91 Dec    5    2019 networks
-rw-r--r-- 1 root root                267 Dec    5    2019 legal
-rw-r--r-- 1 root root                  92 Dec    5    2019 host.conf
-rw-r--r-- 1 root root                  13 Dec    5    2019 debian_version
-rw-r--r-- 1 root root                552 Dec 17    2019 pam.conf
-rw-r--r-- 1 root root              1816 Dec 27    2019 ethertypes
-rw-r--r-- 1 root root                111 Jan 16    2020 magic.mime
-rw-r--r-- 1 root root                111 Jan 16    2020 magic
-rw-r--r-- 1 root root                  45 Jan 26    2020 bash_completion
-rw-r--r-- 1 root root              2584 Feb    1    2020 gai.conf
-r--r----- 1 root root                755 Feb    3    2020 sudoers
-rw-r--r-- 1 root root            10037 Feb    7    2020 nanorc
-rw-r--r-- 1 root root            10550 Feb    7    2020 login.defs
-rw-r--r-- 1 root root              1523 Feb 10    2020 usb_modeswitch.conf
-rw-r--r-- 1 root root              1382 Feb 11    2020 rsyslog.conf
-rw-r--r-- 1 root root              1042 Feb 13    2020 crontab
-rw-r--r-- 1 root root              2351 Feb 13    2020 sysctl.conf
-rw-r--r-- 1 root root                808 Feb 14    2020 mke2fs.conf
-rw-r--r-- 1 root root                685 Feb 14    2020 e2scrub.conf
-rw-r--r-- 1 root root            14464 Feb 16    2020 services
-rw-r--r-- 1 root root                191 Feb 18    2020 libaudit.conf
drwxr-xr-x 2 root root              4096 Feb 24    2020 usb_modeswitch.d
-rw-r--r-- 1 root root              1748 Feb 25    2020 inputrc
-rw-r--r-- 1 root root              2319 Feb 25    2020 bash.bashrc
-rw-r--r-- 1 root root              5215 Feb 25    2020 manpath.config
-rw-r--r-- 1 root root                  41 Apr    6    2020 multipath.conf
-rw-r--r-- 1 root root              2996 Apr 14    2020 locale.alias
-rw-r--r-- 1 root root                  34 Apr 14    2020 ld.so.conf
-rw-r--r-- 1 root root                367 Apr 14    2020 bindresvport.blacklist
drwxr-xr-x 2 root root              4096 Apr 22    2020 binfmt.d
-rw-r--r-- 1 root root              6920 Nov    2    2021 overlayroot.conf
-rw-r--r-- 1 root root              4942 Nov 12    2021 wgetrc
-rw-r--r-- 1 root root                477 Feb 10    2022 zsh_command_not_found
drwxrwxr-x 2 root landscape    4096 Feb 14    2022 landscape
lrwxrwxrwx 1 root root                  13 Mar 15    2022 rmt -> /usr/sbin/rmt
-rw-r--r-- 1 root root            10593 Mar 31    2022 sensors3.conf
drwxr-xr-x 2 root root              4096 Apr 25 14:02 update-notifier
drwxr-xr-x 2 root root              4096 Jul 24 21:38 opt
drwxr-xr-x 2 root root              4096 Jul 24 21:38 selinux
drwxr-xr-x 2 root root              4096 Jul 24 21:38 terminfo
-rw-r--r-- 1 root root              3028 Jul 24 21:38 adduser.conf
lrwxrwxrwx 1 root root                  39 Jul 24 21:38 resolv.conf ->
../run/systemd/resolve/st                  ub-resolv.conf
lrwxrwxrwx 1 root root                  19 Jul 24 21:38 mtab -> ../proc/self/mounts
drwxr-xr-x 7 root root              4096 Jul 24 21:38 apt
drwxr-xr-x 3 root root              4096 Jul 24 21:38 ca-certificates
drwxr-xr-x 4 root root              4096 Jul 24 21:38 dbus-1
drwxr-xr-x 8 root root              4096 Jul 24 21:38 networkd-dispatcher
drwxr-xr-x 4 root root              4096 Jul 24 21:38 xdg
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.hourly
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.monthly
-rw-r--r-- 1 root root                510 Jul 24 21:38 nsswitch.conf
-rw-r--r-- 1 root root                195 Jul 24 21:38 modules
drwxr-xr-x 2 root root              4096 Jul 24 21:38 newt
drwxr-xr-x 4 root root              4096 Jul 24 21:38 iproute2
-rw-r--r-- 1 root root              5713 Jul 24 21:38 ca-certificates.conf.dpkg-old
drwxr-xr-x 2 root root              4096 Jul 24 21:38 python3
lrwxrwxrwx 1 root root                  23 Jul 24 21:38 vtrgb ->
/etc/alternatives/vtrgb
drwxr-xr-x 2 root root              4096 Jul 24 21:38 skel
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dpkg
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ld.so.conf.d
drwxr-xr-x 4 root root              4096 Jul 24 21:39 security
-rw-r--r-- 1 root root                106 Jul 24 21:39 environment
drwxr-xr-x 4 root root              4096 Jul 24 21:39 ssl
drwxr-xr-x 2 root root              4096 Jul 24 21:39 python3.8
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dhcp
drwxr-xr-x 2 root root              4096 Jul 24 21:39 depmod.d
-rw-r--r-- 1 root root              6821 Jul 24 21:39 ca-certificates.conf
-rw-r--r-- 1 root root                110 Jul 24 21:39 kernel-img.conf
drwxr-xr-x 3 root root              4096 Jul 24 21:39 perl
drwxr-xr-x 3 root root              4096 Jul 24 21:39 gss
-rw-r--r-- 1 root root                  54 Jul 24 21:39 crypttab
drwxr-xr-x 5 root root              4096 Jul 24 21:39 kernel
drwxr-xr-x 3 root root              4096 Jul 24 21:39 dconf
drwxr-xr-x 4 root root              4096 Jul 24 21:39 network
drwxr-xr-x 4 root root              4096 Jul 24 21:39 pki
drwxr-xr-x 3 root root              4096 Jul 24 21:39 pm
drwxr-xr-x 3 root root              4096 Jul 24 21:39 libblockdev
drwxr-xr-x 4 root root              4096 Jul 24 21:39 polkit-1
drwxr-xr-x 3 root root              4096 Jul 24 21:39 ModemManager
drwxr-xr-x 3 root root              4096 Jul 24 21:39 NetworkManager
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ldap
drwxr-xr-x 3 root root              4096 Jul 24 21:39 apparmor
-rw-r--r-- 1 root root                711 Jul 24 21:39 hosts.deny
-rw-r--r-- 1 root root                411 Jul 24 21:39 hosts.allow
drwxr-xr-x 2 root root              4096 Jul 24 21:39 calendar
drwxr-xr-x 2 root root              4096 Jul 24 21:39 modprobe.d
drwxr-xr-x 2 root root              4096 Jul 24 21:39 mdadm
drwxr-xr-x 2 root root              4096 Jul 24 21:39 byobu
drwxr-xr-x 2 root root              4096 Jul 24 21:39 tmpfiles.d
-rw-r--r-- 1 root root                146 Jul 24 21:39 shells
drwxr-xr-x 2 root root              4096 Jul 24 21:39 iscsi
drwxr-xr-x 2 root root              4096 Jul 24 21:40 groff
drwxr-xr-x 5 root root              4096 Jul 24 21:40 initramfs-tools
drwxr-xr-x 2 root root              4096 Jul 24 21:40 rsyslog.d
drwxr-xr-x 3 root root              4096 Jul 24 21:40 ufw
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cryptsetup-initramfs
drwxr-xr-x 2 root root              4096 Jul 24 21:40 udisks2
drwxr-xr-x 3 root root              4096 Jul 24 21:40 apport
drwxr-xr-x 2 root root              4096 Jul 24 21:40 bash_completion.d
drwxr-xr-x 2 root root              4096 Jul 24 21:40 pollinate
drwxr-xr-x 3 root root              4096 Jul 24 21:40 fwupd
drwxr-xr-x 3 root root              4096 Jul 24 21:40 lvm
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cron.weekly
drwxr-xr-x 2 root root              4096 Jul 24 21:40 PackageKit
-rw-r--r-- 1 root root                  33 Jul 24 21:40 ec2_version
drwxr-xr-x 2 root root              4096 Jul 24 21:40 console-setup
-rw-r--r-- 1 root root                    0 Jul 24 21:40 popularity-contest.conf
-rw-r--r-- 1 root root              9440 Jul 24 21:40 locale.gen
-rw-r--r-- 1 root root                112 Jul 24 21:40 overlayroot.local.conf
-rw-r--r-- 1 root root                  84 Jul 24 21:41 fstab
drwxr-xr-x 2 root root              4096 Jul 24 21:41 grub.d
drwxr-xr-x 2 root root              4096 Aug    1 05:31 netplan
drwxr-xr-x 3 root root              4096 Aug    1 05:32 qemu
drwxr-xr-x 4 root root              4096 Aug    1 05:32 cloud
-rw-r--r-- 1 root root                104 Aug 22 10:53 lsb-release
lrwxrwxrwx 1 root root                  21 Aug 22 10:54 os-release -> ../usr/lib/os-
release
-rw-r--r-- 1 root root                  19 Aug 22 10:54 issue.net
-rw-r--r-- 1 root root                  26 Aug 22 10:54 issue
drwx------ 2 root root              4096 Aug 26 08:20 multipath
-r--r--r-- 1 root root                  33 Aug 26 08:20 machine-id
drwxr-xr-x 4 root root              4096 Aug 27 06:07 vmware-tools
-rw-r--r-- 1 root root                    8 Sep    8 06:16 timezone
lrwxrwxrwx 1 root root                  27 Sep    8 06:16 localtime ->
/usr/share/zoneinfo/Etc/UTC
drwxr-xr-x 5 root root              4096 Sep 19 09:45 vulkan
drwxr-xr-x 7 root root              4096 Sep 19 09:46 X11
drwxr-xr-x 2 root root              4096 Sep 19 09:46 rcS.d
drwxr-xr-x 2 root root              4096 Sep 19 09:46 sensors.d
drwxr-xr-x 4 root root              4096 Sep 19 09:46 fonts
drwxr-xr-x 2 root root              4096 Sep 19 09:46 environment.d
drwxr-xr-x 5 root root              4096 Sep 19 09:46 java-11-openjdk
-rw-r--r-- 1 root root                  15 Sep 20 05:01 hostname
drwxr-xr-x 2 root root              4096 Sep 20 06:40 vim
-rw-r--r-- 1 root root              3956 Sep 20 06:40 mailcap
-rw-r--r-- 1 root root                363 Sep 21 08:44 hosts
drwxr-xr-x 8 root root              4096 Sep 22 15:42 apache2
drwxr-xr-x 2 root root              4096 Sep 22 15:42 cron.daily
drwxr-xr-x 2 root root              4096 Sep 23 09:32 wildfly
drwxr-xr-x 2 root root              4096 Sep 25 18:18 process-exporter
drwxr-xr-x 6 root root              4096 Sep 28 06:24 sos
drwxr-xr-x 2 root root              4096 Oct    2 17:35 profile.d
drwxr-xr-x 2 root root              4096 Oct    2 17:35 sysctl.d
drwxr-xr-x 2 root root              4096 Oct    2 17:35 modules-load.d
drwxr-xr-x 4 root root              4096 Oct    2 17:35 udev
drwxr-xr-x 3 root root              4096 Oct    2 17:35 update-manager
drwxr-xr-x 2 root root              4096 Oct    2 17:35 ubuntu-advantage
drwxr-xr-x 2 root root              4096 Oct    2 17:35 update-motd.d
drwxr-xr-x 5 root root              4096 Oct    2 17:36 systemd
drwxr-xr-x 2 root root              4096 Oct    2 17:36 pam.d
drwxr-x--- 2 root root              4096 Oct    3 08:54 sudoers.d
drwxr-xr-x 4 root root              4096 Oct    3 08:56 ssh
drwxr-xr-x 8 root root              4096 Oct    3 12:32 nginx
-rw-r--r-- 1 root root                178 Oct    4 07:58 subuid-
-rw-r--r-- 1 root root                178 Oct    4 07:58 subgid-
-rw-r----- 1 root shadow            944 Oct    4 08:45 gshadow-
-rw-r--r-- 1 root root              1136 Oct    4 08:45 group-
-rw-r--r-- 1 root root                203 Oct    4 08:45 subuid
-rw-r--r-- 1 root root                203 Oct    4 08:45 subgid
-rw-r----- 1 root shadow          1907 Oct    4 08:59 shadow-
-rw-r--r-- 1 root root              2362 Oct    4 08:59 passwd-
-rw-r--r-- 1 root root              1149 Oct    4 08:59 group
-rw-r----- 1 root shadow            954 Oct    4 08:59 gshadow
-rw-r----- 1 root shadow          1907 Oct    4 08:59 shadow
-rw-r--r-- 1 root root              2377 Oct    4 08:59 passwd
drwxr-xr-x 6 root root              4096 Oct    4 08:59 logcheck
drwxr-xr-x 3 root root              4096 Oct    4 08:59 php
drwxr-xr-x 2 root root              4096 Oct    4 08:59 cron.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 alternatives
drwxr-xr-x 7 root root              4096 Oct    4 08:59 apparmor.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 insserv.conf.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 init.d
drwxr-xr-x 3 root root              4096 Oct    4 08:59 default
drwxr-xr-x 2 root root              4096 Oct    4 08:59 logrotate.d
drwxr-xr-x 4 root root              4096 Oct    4 08:59 mysql
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc6.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc5.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc4.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc3.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc2.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc1.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc0.d
-rw-r--r-- 1 root root            31764 Oct    4 08:59 ld.so.cache
141.95.160.133 | CHANGED | rc=0 >>
total 884
-rw-r--r-- 1 root root                887 Apr    1    2013 rpc
-rw-r--r-- 1 root root              2932 Apr    1    2013 protocols
-rw-r--r-- 1 root root                280 Jun 20    2014 fuse.conf
-rw-r--r-- 1 root root              3663 Jun 20    2016 screenrc
-rw-r--r-- 1 root root                604 Sep 15    2018 deluser.conf
-rw-r----- 1 root daemon            144 Nov 12    2018 at.deny
-rw-r--r-- 1 root root              1260 Dec 14    2018 ucf.conf
-rw-r--r-- 1 root root                533 Jan 21    2019 logrotate.conf
-rw-r--r-- 1 root root            14867 Feb    1    2019 ltrace.conf
-rw-r--r-- 1 root root              2969 Aug    3    2019 debconf.conf
-rw-r--r-- 1 root root              5060 Aug 21    2019 hdparm.conf
-rw-r--r-- 1 root root                642 Sep 24    2019 xattr.conf
-rw-r--r-- 1 root root            24546 Oct 18    2019 mime.types
-rw-r--r-- 1 root root                449 Oct 18    2019 mailcap.order
-rw-r--r-- 1 root root                581 Dec    5    2019 profile
-rw-r--r-- 1 root root                  91 Dec    5    2019 networks
-rw-r--r-- 1 root root                267 Dec    5    2019 legal
-rw-r--r-- 1 root root                  92 Dec    5    2019 host.conf
-rw-r--r-- 1 root root                  13 Dec    5    2019 debian_version
-rw-r--r-- 1 root root                552 Dec 17    2019 pam.conf
-rw-r--r-- 1 root root              1816 Dec 27    2019 ethertypes
-rw-r--r-- 1 root root                111 Jan 16    2020 magic.mime
-rw-r--r-- 1 root root                111 Jan 16    2020 magic
-rw-r--r-- 1 root root                  45 Jan 26    2020 bash_completion
-rw-r--r-- 1 root root              2584 Feb    1    2020 gai.conf
-r--r----- 1 root root                755 Feb    3    2020 sudoers
-rw-r--r-- 1 root root            10037 Feb    7    2020 nanorc
-rw-r--r-- 1 root root            10550 Feb    7    2020 login.defs
-rw-r--r-- 1 root root              1523 Feb 10    2020 usb_modeswitch.conf
-rw-r--r-- 1 root root              1382 Feb 11    2020 rsyslog.conf
-rw-r--r-- 1 root root              1042 Feb 13    2020 crontab
-rw-r--r-- 1 root root              2351 Feb 13    2020 sysctl.conf
-rw-r--r-- 1 root root                808 Feb 14    2020 mke2fs.conf
-rw-r--r-- 1 root root                685 Feb 14    2020 e2scrub.conf
-rw-r--r-- 1 root root            14464 Feb 16    2020 services
-rw-r--r-- 1 root root                191 Feb 18    2020 libaudit.conf
drwxr-xr-x 2 root root              4096 Feb 24    2020 usb_modeswitch.d
-rw-r--r-- 1 root root              1748 Feb 25    2020 inputrc
-rw-r--r-- 1 root root              2319 Feb 25    2020 bash.bashrc
-rw-r--r-- 1 root root              5215 Feb 25    2020 manpath.config
-rw-r--r-- 1 root root                  41 Apr    6    2020 multipath.conf
-rw-r--r-- 1 root root              2996 Apr 14    2020 locale.alias
-rw-r--r-- 1 root root                  34 Apr 14    2020 ld.so.conf
-rw-r--r-- 1 root root                367 Apr 14    2020 bindresvport.blacklist
drwxr-xr-x 2 root root              4096 Apr 22    2020 binfmt.d
-rw-r--r-- 1 root root              6920 Nov    2    2021 overlayroot.conf
-rw-r--r-- 1 root root              4942 Nov 12    2021 wgetrc
-rw-r--r-- 1 root root                477 Feb 10    2022 zsh_command_not_found
drwxrwxr-x 2 root landscape    4096 Feb 14    2022 landscape
lrwxrwxrwx 1 root root                  13 Mar 15    2022 rmt -> /usr/sbin/rmt
-rw-r--r-- 1 root root            10593 Mar 31    2022 sensors3.conf
drwxr-xr-x 2 root root              4096 Apr 25 14:02 update-notifier
drwxr-xr-x 2 root root              4096 Jul 24 21:38 opt
drwxr-xr-x 2 root root              4096 Jul 24 21:38 selinux
drwxr-xr-x 2 root root              4096 Jul 24 21:38 terminfo
-rw-r--r-- 1 root root              3028 Jul 24 21:38 adduser.conf
lrwxrwxrwx 1 root root                  39 Jul 24 21:38 resolv.conf ->
../run/systemd/resolve/st                  ub-resolv.conf
lrwxrwxrwx 1 root root                  19 Jul 24 21:38 mtab -> ../proc/self/mounts
drwxr-xr-x 7 root root              4096 Jul 24 21:38 apt
drwxr-xr-x 3 root root              4096 Jul 24 21:38 ca-certificates
drwxr-xr-x 4 root root              4096 Jul 24 21:38 dbus-1
drwxr-xr-x 8 root root              4096 Jul 24 21:38 networkd-dispatcher
drwxr-xr-x 4 root root              4096 Jul 24 21:38 xdg
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.hourly
drwxr-xr-x 2 root root              4096 Jul 24 21:38 cron.monthly
-rw-r--r-- 1 root root                510 Jul 24 21:38 nsswitch.conf
-rw-r--r-- 1 root root                195 Jul 24 21:38 modules
drwxr-xr-x 2 root root              4096 Jul 24 21:38 newt
drwxr-xr-x 4 root root              4096 Jul 24 21:38 iproute2
-rw-r--r-- 1 root root              5713 Jul 24 21:38 ca-certificates.conf.dpkg-old
drwxr-xr-x 2 root root              4096 Jul 24 21:38 python3
lrwxrwxrwx 1 root root                  23 Jul 24 21:38 vtrgb ->
/etc/alternatives/vtrgb
drwxr-xr-x 2 root root              4096 Jul 24 21:38 skel
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dpkg
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ld.so.conf.d
drwxr-xr-x 4 root root              4096 Jul 24 21:39 security
-rw-r--r-- 1 root root                106 Jul 24 21:39 environment
drwxr-xr-x 4 root root              4096 Jul 24 21:39 ssl
drwxr-xr-x 2 root root              4096 Jul 24 21:39 python3.8
drwxr-xr-x 4 root root              4096 Jul 24 21:39 dhcp
drwxr-xr-x 2 root root              4096 Jul 24 21:39 depmod.d
-rw-r--r-- 1 root root              6821 Jul 24 21:39 ca-certificates.conf
-rw-r--r-- 1 root root                110 Jul 24 21:39 kernel-img.conf
drwxr-xr-x 3 root root              4096 Jul 24 21:39 perl
drwxr-xr-x 3 root root              4096 Jul 24 21:39 gss
-rw-r--r-- 1 root root                  54 Jul 24 21:39 crypttab
drwxr-xr-x 5 root root              4096 Jul 24 21:39 kernel
drwxr-xr-x 3 root root              4096 Jul 24 21:39 dconf
drwxr-xr-x 4 root root              4096 Jul 24 21:39 network
drwxr-xr-x 4 root root              4096 Jul 24 21:39 pki
drwxr-xr-x 3 root root              4096 Jul 24 21:39 pm
drwxr-xr-x 3 root root              4096 Jul 24 21:39 libblockdev
drwxr-xr-x 4 root root              4096 Jul 24 21:39 polkit-1
drwxr-xr-x 3 root root              4096 Jul 24 21:39 ModemManager
drwxr-xr-x 3 root root              4096 Jul 24 21:39 NetworkManager
drwxr-xr-x 2 root root              4096 Jul 24 21:39 ldap
drwxr-xr-x 3 root root              4096 Jul 24 21:39 apparmor
-rw-r--r-- 1 root root                711 Jul 24 21:39 hosts.deny
-rw-r--r-- 1 root root                411 Jul 24 21:39 hosts.allow
drwxr-xr-x 2 root root              4096 Jul 24 21:39 calendar
drwxr-xr-x 2 root root              4096 Jul 24 21:39 modprobe.d
drwxr-xr-x 2 root root              4096 Jul 24 21:39 mdadm
drwxr-xr-x 2 root root              4096 Jul 24 21:39 byobu
drwxr-xr-x 2 root root              4096 Jul 24 21:39 tmpfiles.d
-rw-r--r-- 1 root root                146 Jul 24 21:39 shells
drwxr-xr-x 2 root root              4096 Jul 24 21:39 iscsi
drwxr-xr-x 2 root root              4096 Jul 24 21:40 groff
drwxr-xr-x 5 root root              4096 Jul 24 21:40 initramfs-tools
drwxr-xr-x 2 root root              4096 Jul 24 21:40 rsyslog.d
drwxr-xr-x 3 root root              4096 Jul 24 21:40 ufw
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cryptsetup-initramfs
drwxr-xr-x 2 root root              4096 Jul 24 21:40 udisks2
drwxr-xr-x 3 root root              4096 Jul 24 21:40 apport
drwxr-xr-x 2 root root              4096 Jul 24 21:40 bash_completion.d
drwxr-xr-x 2 root root              4096 Jul 24 21:40 pollinate
drwxr-xr-x 3 root root              4096 Jul 24 21:40 fwupd
drwxr-xr-x 3 root root              4096 Jul 24 21:40 lvm
drwxr-xr-x 2 root root              4096 Jul 24 21:40 cron.weekly
drwxr-xr-x 2 root root              4096 Jul 24 21:40 PackageKit
-rw-r--r-- 1 root root                  33 Jul 24 21:40 ec2_version
drwxr-xr-x 2 root root              4096 Jul 24 21:40 console-setup
-rw-r--r-- 1 root root                    0 Jul 24 21:40 popularity-contest.conf
-rw-r--r-- 1 root root              9440 Jul 24 21:40 locale.gen
-rw-r--r-- 1 root root                112 Jul 24 21:40 overlayroot.local.conf
-rw-r--r-- 1 root root                  84 Jul 24 21:41 fstab
drwxr-xr-x 2 root root              4096 Jul 24 21:41 grub.d
drwxr-xr-x 2 root root              4096 Aug    1 05:31 netplan
drwxr-xr-x 3 root root              4096 Aug    1 05:32 qemu
drwxr-xr-x 4 root root              4096 Aug    1 05:32 cloud
-rw-r--r-- 1 root root                104 Aug 22 10:53 lsb-release
lrwxrwxrwx 1 root root                  21 Aug 22 10:54 os-release -> ../usr/lib/os-
release
-rw-r--r-- 1 root root                  19 Aug 22 10:54 issue.net
-rw-r--r-- 1 root root                  26 Aug 22 10:54 issue
drwx------ 2 root root              4096 Sep 14 10:23 multipath
-r--r--r-- 1 root root                  33 Sep 14 10:23 machine-id
-rw-r--r-- 1 root root                271 Sep 14 10:23 hosts
-rw-r--r-- 1 root root                    8 Sep 14 10:30 timezone
lrwxrwxrwx 1 root root                  27 Sep 14 10:30 localtime ->
/usr/share/zoneinfo/Etc/UTC
drwxr-xr-x 4 root root              4096 Sep 14 10:30 vmware-tools
drwxr-xr-x 4 root root              4096 Sep 14 13:28 ssh
drwxr-xr-x 2 root root              4096 Sep 20 06:33 vim
-rw-r--r-- 1 root root                  15 Sep 20 07:01 hostname
drwxr-xr-x 5 root root              4096 Sep 20 07:02 vulkan
drwxr-xr-x 7 root root              4096 Sep 20 07:02 X11
drwxr-xr-x 2 root root              4096 Sep 20 07:02 rcS.d
drwxr-xr-x 2 root root              4096 Sep 20 07:02 sensors.d
drwxr-xr-x 4 root root              4096 Sep 20 07:02 fonts
drwxr-xr-x 2 root root              4096 Sep 20 07:02 environment.d
drwxr-xr-x 5 root root              4096 Sep 20 07:02 java-11-openjdk
-rw-r--r-- 1 root root              3891 Sep 20 07:02 mailcap
drwxr-xr-x 2 root root              4096 Sep 24 19:46 process-exporter
drwxr-xr-x 2 root root              4096 Sep 25 11:29 wildfly
drwxr-xr-x 6 root root              4096 Sep 27 06:06 sos
drwxr-x--- 2 root root              4096 Oct    3 08:58 sudoers.d
drwxr-xr-x 8 root root              4096 Oct    3 12:32 nginx
drwxr-xr-x 8 root root              4096 Oct    3 15:25 apache2
drwxr-xr-x 2 root root              4096 Oct    3 15:25 cron.daily
-rw-r--r-- 1 root root                  98 Oct    4 07:58 subuid-
-rw-r--r-- 1 root root                  98 Oct    4 07:58 subgid-
drwxr-xr-x 2 root root              4096 Oct    4 08:24 profile.d
drwxr-xr-x 2 root root              4096 Oct    4 08:24 sysctl.d
drwxr-xr-x 2 root root              4096 Oct    4 08:24 modules-load.d
drwxr-xr-x 4 root root              4096 Oct    4 08:24 udev
drwxr-xr-x 3 root root              4096 Oct    4 08:24 update-manager
drwxr-xr-x 2 root root              4096 Oct    4 08:24 ubuntu-advantage
drwxr-xr-x 2 root root              4096 Oct    4 08:24 update-motd.d
drwxr-xr-x 5 root root              4096 Oct    4 08:24 systemd
drwxr-xr-x 2 root root              4096 Oct    4 08:24 pam.d
-rw-r----- 1 root shadow            875 Oct    4 08:45 gshadow-
-rw-r--r-- 1 root root              1048 Oct    4 08:45 group-
-rw-r--r-- 1 root root                123 Oct    4 08:45 subuid
-rw-r--r-- 1 root root                123 Oct    4 08:45 subgid
-rw-r----- 1 root shadow          1560 Oct    4 08:59 shadow-
-rw-r--r-- 1 root root              2130 Oct    4 08:59 passwd-
-rw-r--r-- 1 root root              1061 Oct    4 08:59 group
-rw-r----- 1 root shadow            885 Oct    4 08:59 gshadow
-rw-r----- 1 root shadow          1560 Oct    4 08:59 shadow
-rw-r--r-- 1 root root              2145 Oct    4 08:59 passwd
drwxr-xr-x 6 root root              4096 Oct    4 08:59 logcheck
drwxr-xr-x 3 root root              4096 Oct    4 08:59 php
drwxr-xr-x 2 root root              4096 Oct    4 08:59 cron.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 alternatives
drwxr-xr-x 7 root root              4096 Oct    4 08:59 apparmor.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 insserv.conf.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 init.d
drwxr-xr-x 3 root root              4096 Oct    4 08:59 default
drwxr-xr-x 2 root root              4096 Oct    4 08:59 logrotate.d
drwxr-xr-x 4 root root              4096 Oct    4 08:59 mysql
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc6.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc5.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc4.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc3.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc2.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc1.d
drwxr-xr-x 2 root root              4096 Oct    4 08:59 rc0.d
-rw-r--r-- 1 root root            31764 Oct    4 08:59 ld.so.cache
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp"
146.59.158.16 | CHANGED | rc=0 >>
total 48
drwx------ 3 root          root          4096 Aug 26 08:20 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-systemd-logind.service-68Kuej
drwx------ 3 root          root          4096 Aug 26 08:20 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-ModemManager.service-cIU2Ef
drwx------ 3 root          root          4096 Aug 26 08:20 snap.lxd
drwx------ 3 root          root          4096 Aug 31 21:07 snap.tree
drwxr-xr-x 2 root          root          4096 Sep 21 10:05 hsperfdata_root
drwxr-xr-x 2 wildfly    wildfly    4096 Sep 25 13:32 hsperfdata_wildfly
drwxr-xr-x 2 apx03        apx03        4096 Sep 26 09:17 hsperfdata_apx03
drwx------ 3 root          root          4096 Oct    2 17:36 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-systemd-resolved.service-xYNRni
drwx------ 3 root          root          4096 Oct    2 17:36 systemd-private-
588107954b074b39980b7c                  ddbcfcdf42-systemd-timesyncd.service-fMKZlf
-rwxrwxrwx 1 ansadmin ansadmin        0 Oct    3 10:15 cible1.txt
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
drwxr-xr-x 2 ansadmin ansadmin 4096 Oct    4 08:20 dir
drwxr-xr-x 2 root          root          4096 Oct    4 09:43 Debian
drwx------ 2 root          root          4096 Oct    4 09:45
ansible_command_payload_eh82ie9y
141.95.160.133 | CHANGED | rc=0 >>
total 44
drwx------ 3 root          root          4096 Sep 14 10:23 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-systemd-logind.service-pnYtUi
drwx------ 3 root          root          4096 Sep 14 10:23 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-ModemManager.service-1Rmclg
drwx------ 3 root          root          4096 Sep 14 10:23 snap.lxd
drwxr-xr-x 2 root          root          4096 Sep 21 09:23 hsperfdata_root
drwxr-xr-x 2 etl03        etl03        4096 Sep 21 10:24 hsperfdata_etl03
drwxr-xr-x 2 wildfly    wildfly    4096 Sep 25 15:04 hsperfdata_wildfly
-rw-r--r-- 1 ansadmin ansadmin        0 Oct    4 08:16 test.txt
drwxr-xr-x 2 ansadmin ansadmin 4096 Oct    4 08:20 dir
drwx------ 3 root          root          4096 Oct    4 08:24 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-systemd-resolved.service-dSPAvh
drwx------ 3 root          root          4096 Oct    4 08:24 systemd-private-
0c62a6f1854e46959ec934                  668ec6cc97-systemd-timesyncd.service-XoIIlf
drwxr-xr-x 2 root          root          4096 Oct    4 09:43 Debian
drwx------ 2 root          root          4096 Oct    4 09:45
ansible_command_payload_rz12wo4b
ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
──

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Tue Oct    4 08:53:18 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc | grep Deb"
146.59.158.16 | FAILED | rc=1 >>
non-zero return code
141.95.160.133 | FAILED | rc=1 >>
non-zero return code
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation]
***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation]
***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=                  1        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=                  1        rescued=0        ignored=0
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc | grep Deb"
146.59.158.16 | FAILED | rc=1 >>
non-zero return code
141.95.160.133 | FAILED | rc=1 >>
non-zero return code
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /etc | grep redhat"
146.59.158.16 | FAILED | rc=1 >>
non-zero return code
141.95.160.133 | FAILED | rc=1 >>
non-zero return code
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation]
***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation]
***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=                  1        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=                  1        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim rep.yaml
ansadmin@svl200:~$ ansible-playbook rep.yaml

PLAY [Creation de repertoire]


*********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation repertoire]


************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]
TASK [Creation repertoire]
************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Creation fichier]


***************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [Creation fichier]


***************************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=3        changed=1        unreachable=0 
failed=0        skipped=                  2        rescued=0        ignored=0
146.59.158.16                            : ok=3        changed=1        unreachable=0
failed=0        skipped=                  2        rescued=0        ignored=0

ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/redhat | grep redhat"
146.59.158.16 | FAILED | rc=1 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=1 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/redhat"
146.59.158.16 | FAILED | rc=2 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=2 >>
ls: cannot access '/tmp/redhat': No such file or directorynon-zero return code
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/Redhat"
146.59.158.16 | FAILED | rc=2 >>
ls: cannot access '/tmp/Redhat': No such file or directorynon-zero return code
141.95.160.133 | FAILED | rc=2 >>
ls: cannot access '/tmp/Redhat': No such file or directorynon-zero return code
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/Debian"
146.59.158.16 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
141.95.160.133 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp/Debian"
146.59.158.16 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
141.95.160.133 | CHANGED | rc=0 >>
total 0
-rw-r--r-- 1 root root 0 Oct    4 09:57 Debian.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook list.yaml
PLAY [exemple ansible list]
***********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install package]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim list.yaml
ansadmin@svl200:~$ sudo vim list.yaml
ansadmin@svl200:~$ ansible-playbook list.yaml

PLAY [exemple ansible list]


***********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install package]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ ansible-playbook items.yaml

PLAY [exemple avec items]


*************************************************************
TASK [Gathering Facts]
****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*************************************************
changed: [146.59.158.16] => (item=init1.txt)
changed: [141.95.160.133] => (item=init1.txt)
changed: [146.59.158.16] => (item=init2.txt)
changed: [141.95.160.133] => (item=init2.txt)
changed: [146.59.158.16] => (item=init3.txt)
changed: [141.95.160.133] => (item=init3.txt)
changed: [146.59.158.16] => (item=init4.txt)
changed: [141.95.160.133] => (item=init4.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ ansible-playbook items.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*************************************************
changed: [146.59.158.16] => (item=init1.txt)
changed: [141.95.160.133] => (item=init1.txt)
changed: [146.59.158.16] => (item=init2.txt)
changed: [141.95.160.133] => (item=init2.txt)
changed: [146.59.158.16] => (item=init3.txt)
changed: [141.95.160.133] => (item=init3.txt)
changed: [146.59.158.16] => (item=init4.txt)
changed: [141.95.160.133] => (item=init4.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin"
146.59.158.16 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            18 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
total 16
-rw-rw-r-- 1 ansadmin ansadmin 598 Oct    3 13:02 resultat.txt
-rw-r--r-- 1 root          root            56 Oct    3 14:02 Debian.txt
-rw-r--r-- 1 root          root            35 Oct    3 14:41 var.txt
-rw-r--r-- 1 root          root            19 Oct    3 14:46 ip.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    3 20:36 Devops27.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep init"
146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init1.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:19 init2.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init3.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 10:20 init4.txt
ansadmin@svl200:~$ sudo vim items_users.yaml
ansadmin@svl200:~$ sudo -f items_users.yaml
sudo: invalid option -- 'f'
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
                        [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
                        [-T timeout] [-u user] file ...
ansadmin@svl200:~$
ansadmin@svl200:~$ rm items_users.yaml
rm: remove write-protected regular empty file 'items_users.yaml'?
ansadmin@svl200:~$
ansadmin@svl200:~$ cp items.yaml item_users.yaml
ansadmin@svl200:~$ sudo vim items_users.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo3.yaml      handler.yaml          items.yaml               
rep.yaml              when.yaml
debug.yaml      exo4.yaml      index.html              items_users.yaml    seq.yaml 
when1.yaml
debug1.yaml    fact.yaml      ip.txt                      list.yaml                 
shell.yml
exo2.yaml        fact1.yaml    item_users.yaml    nginx.yaml               
template.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo3.yaml      handler.yaml          items.yaml               
rep.yaml              when.yaml
debug.yaml      exo4.yaml      index.html              items_users.yaml    seq.yaml 
when1.yaml
debug1.yaml    fact.yaml      ip.txt                      list.yaml                 
shell.yml
exo2.yaml        fact1.yaml    item_users.yaml    nginx.yaml               
template.yaml
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefin                  ed variable. The error was: 'user' is undefined\n\nThe error
appears to be in '/home/an                  sadmin/item_users.yaml': line 7, column
5, but may\nbe elsewhere in the file depending                    on the exact syntax
problem.\n\nThe offending line appears to be:\n\n    tasks:\n    - name             
: creation d'utilisateurs\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefi                  ned variable. The error was: 'user' is undefined\n\nThe error
appears to be in '/home/a                  nsadmin/item_users.yaml': line 7, column
5, but may\nbe elsewhere in the file depending                    on the exact syntax
problem.\n\nThe offending line appears to be:\n\n    tasks:\n    - nam               
e: creation d'utilisateurs\n        ^ here\n"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
failed: [146.59.158.16] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}^L
failed: [146.59.158.16] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim items.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
failed: [146.59.158.16] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user1.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user1.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user2.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user2.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user3.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user3.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user4.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user4.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}
failed: [146.59.158.16] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fal                  se, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Support                  ed parameters include: append,
authorization, comment, create_home, expires, force, gen                 
erate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_un                  ique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key_                  bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system, u                  id,
update_password"}
failed: [141.95.160.133] (item=user5.txt) => {"ansible_loop_var": "item", "changed":
fa                  lse, "item": "user5.txt", "msg": "Unsupported parameters for
(user) module: path Suppor                  ted parameters include: append,
authorization, comment, create_home, expires, force, ge                 
nerate_ssh_key, group, groups, hidden, home, local, login_class, move_home, name,
non_u                  nique, password, password_lock, profile, remove, role, seuser,
shell, skeleton, ssh_key                  _bits, ssh_key_comment, ssh_key_file,
ssh_key_passphrase, ssh_key_type, state, system,                    uid,
update_password"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
changed: [146.59.158.16] => (item=user1.txt)
changed: [141.95.160.133] => (item=user1.txt)
ok: [146.59.158.16] => (item=user2.txt)
ok: [141.95.160.133] => (item=user2.txt)
ok: [146.59.158.16] => (item=user3.txt)
ok: [141.95.160.133] => (item=user3.txt)
ok: [146.59.158.16] => (item=user4.txt)
ok: [141.95.160.133] => (item=user4.txt)
ok: [146.59.158.16] => (item=user5.txt)
ok: [141.95.160.133] => (item=user5.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim item_users.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook item_users.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation d'utilisateurs]


********************************************************
ok: [146.59.158.16] => (item=user1.txt)
ok: [141.95.160.133] => (item=user1.txt)
ok: [146.59.158.16] => (item=user2.txt)
ok: [141.95.160.133] => (item=user2.txt)
ok: [146.59.158.16] => (item=user3.txt)
ok: [141.95.160.133] => (item=user3.txt)
ok: [146.59.158.16] => (item=user4.txt)
ok: [141.95.160.133] => (item=user4.txt)
ok: [146.59.158.16] => (item=user5.txt)
ok: [141.95.160.133] => (item=user5.txt)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

    System information as of Tue Oct    4 12:03:00 UTC 2022

    System load:                      0.91


    Usage of /:                        13.7% of 38.58GB
    Memory usage:                    48%
    Swap usage:                        0%
    Processes:                          139
    Users logged in:              1
    IPv4 address for ens3: 146.59.156.114
    IPv6 address for ens3: 2001:41d0:304:200::9356

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

9 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Tue Oct    4 09:46:14 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ ansible-playbook seq.yaml

PLAY [exemple avec items]


*************************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [creation de liste des fichiers]


*************************************************
changed: [146.59.158.16] => (item=20)
changed: [141.95.160.133] => (item=20)
changed: [146.59.158.16] => (item=21)
changed: [141.95.160.133] => (item=21)
changed: [146.59.158.16] => (item=22)
changed: [141.95.160.133] => (item=22)
changed: [146.59.158.16] => (item=23)
changed: [141.95.160.133] => (item=23)
changed: [146.59.158.16] => (item=24)
changed: [141.95.160.133] => (item=24)
changed: [146.59.158.16] => (item=25)
changed: [141.95.160.133] => (item=25)
changed: [146.59.158.16] => (item=26)
changed: [141.95.160.133] => (item=26)
changed: [146.59.158.16] => (item=27)
changed: [141.95.160.133] => (item=27)

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim rep.yaml


ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /tmp"
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | Dev"
146.59.158.16 | FAILED | rc=127 >>
/bin/sh: 1: Dev: not foundnon-zero return code
141.95.160.133 | FAILED | rc=127 >>
/bin/sh: 1: Dev: not foundnon-zero return code
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
^[[C146.59.158.16 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops27.txt
141.95.160.133 | CHANGED | rc=0 >>
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops20.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops21.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops22.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops23.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops24.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops25.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops26.txt
-rwxrwxr-x 1 ansadmin ansadmin      0 Oct    4 12:05 Devops27.txt
ansadmin@svl200:~$ sudo vim seq.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo2.yaml    fact1.yaml        item_users.yaml      nginx.yaml   
template.yaml
copie.yaml      exo3.yaml    handler.yaml    items.yaml                rep.yaml     
when.yaml
debug.yaml      exo4.yaml    index.html        items_users.yaml    seq.yaml       
when1.yaml
debug1.yaml    fact.yaml    ip.txt                list.yaml                 
shell.yml
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo2.yaml    fact1.yaml        item_users.yaml      nginx.yaml   
template.yaml
copie.yaml      exo3.yaml    handler.yaml    items.yaml                rep.yaml     
when.yaml
debug.yaml      exo4.yaml    index.html        items_users.yaml    seq.yaml       
when1.yaml
debug1.yaml    fact.yaml    ip.txt                list.yaml                 
shell.yml
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ sudo vim copie.yaml
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Could not find or
access                    'index.html.j2'\nSearched
in:\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansadm                 
in/index.html.j2\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansadmin/
index.html                  .j2 on the Ansible Controller.\nIf you are using a module
and expect the file to exist                    on the remote, see the remote_src
option"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Could not find or
access                    'index.html.j2'\nSearched
in:\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansad                 
min/index.html.j2\n\t/home/ansadmin/templates/index.html.j2\n\t/home/ansadmin/
index.htm                  l.j2 on the Ansible Controller.\nIf you are using a module
and expect the file to exist                    on the remote, see the remote_src
option"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ 146.59.158.16^C
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                    'ansible_all_ipv4_adresses' is
undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_all_ipv4_adresses' is
undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim index.html.j2


ansadmin@svl200:~$ ansible-playbook template.yaml
PLAY [exemple avec template]
**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                    'ansible_all_ipv4_adresses' is
undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_all_ipv4_adresses' is
undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim index.html.j2


ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************
TASK [Gathering Facts]
****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
changed: [146.59.158.16]
changed: [141.95.160.133]

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=2        changed=1        unreachable=0 
failed=0        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=1        unreachable=0
failed=0        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp index.html.j2 index.html1.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                    'ansible_user' is undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_user' is undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ ansible-playbook template.yaml

PLAY [exemple avec template]


**********************************************************

TASK [Gathering Facts]


****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [ajout index.html file]


**********************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:                    'ansible_ssh_user' is undefined"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable                  : 'ansible_ssh_user' is undefined"}

PLAY RECAP
****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=                  0        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=                  0        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ sudo vim index.html.j2
ansadmin@svl200:~$ sudo vim index.html1.j2
ansadmin@svl200:~$ cp template.yaml template1.yaml
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: user, template

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - user:
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml            index.html1.j2        nginx.yaml           
when.yaml
copie.yaml      fact.yaml            ip.txt                        rep.yaml         
when1.yaml
debug.yaml      fact1.yaml          item_users.yaml      seq.yaml
debug1.yaml    handler.yaml      items.yaml                shell.yml
exo2.yaml        index.html          items_users.yaml    template.yaml
exo3.yaml        index.html.j2    list.yaml                  template1.yaml
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: user, template
The error appears to be in '/home/ansadmin/template1.yaml': line 7, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: user, template

The error appears to be in '/home/ansadmin/template1.yaml': line 9, column 7, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src

The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ sudo vim template.yaml
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src
The error appears to be in '/home/ansadmin/template1.yaml': line 10, column 7, but
may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
        - name: creer user
            ^ here
ansadmin@svl200:~$ w
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! A malformed block was encountered while loading tasks: {'template': None,
'src':                    'index.html1', 'dest': '/var/www/html/index.html1'} should
be a list or None but is <c                  lass
'ansible.parsing.yaml.objects.AnsibleMapping'>

The error appears to be in '/home/ansadmin/template1.yaml': line 2, column 3, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: exemple avec template
    ^ here
ansadmin@svl200:~$ wq
wq: command not found
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-vault create hello.yml
New Vault password:    [ERROR]: User interrupted execution
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-vault create hello.yaml
New Vault password:
Confirm New Vault password:
ansadmin@svl200:~$ cp
.ansible/                    cible1.txt                  handler.yaml             
list.yaml
.bash_history            copie.yaml                  hello.yaml                 
nginx.yaml
.bash_logout              debug.yaml                  index.html                 
rep.yaml
.bashrc                        debug1.yaml                index.html.j2           
seq.yaml
.exo4.yaml.swp          exo2.yaml                    index.html1.j2         
shell.yml
.handler.yaml.swp    exo3.yaml                    ip.txt                         
template.yaml
.profile                      exo4.yaml                    item_users.yaml       
template1.yaml
.ssh/                            fact.yaml                    items.yaml             
when.yaml
.viminfo                      fact1.yaml                  items_users.yaml     
when1.yaml
ansadmin@svl200:~$ cat template1.yaml >> hello.yaml
ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$ ansible-playbook hello.yaml
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/hello.yaml': line 15, column 1, but may


be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook hello.yaml --ask-vault-pass
Vault password:
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/hello.yaml': line 15, column 1, but may


be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-vault edit
Vault password:
ansadmin@svl200:~$ ansible-vault create hello.yml
New Vault password:
Confirm New Vault password:
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$ ansible-playbook hello.yaml --ask-vault-pass
Vault password:
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/hello.yaml': line 15, column 1, but may


be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$ sudo vim hello.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook hello.yaml --ask-vault-pass
Vault password:
[WARNING]: Found variable using reserved name: port

PLAY [play with vault]


*********************************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [echo variable]


***********************************************************************
ok: [146.59.158.16] => {
        "msg": "L'utilisateur ofi03 utilise le port 80 sur la machine master-wildfly"
}
ok: [141.95.160.133] => {
        "msg": "L'utilisateur ofi03 utilise le port 80 sur la machine slave1-wildfly"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                gnored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                gnored=0

ansadmin@svl200:~$ sudo vim hello.yaml


ansadmin@svl200:~$ ansible-vault encrypt when2.yaml
New Vault password:
Confirm New Vault password:
ERROR! Unable to read source file (/home/ansadmin/when2.yaml): [Errno 2] No such file
or dir        /ansadmin/when2.yaml'
ansadmin@svl200:~$ ansible-vault encrypt hello.yaml
New Vault password:
Confirm New Vault password:
Encryption successful
ansadmin@svl200:~$
ansadmin@svl200:~$ cat hello.y
hello.yaml    hello.yml
ansadmin@svl200:~$ cat hello.yaml
$ANSIBLE_VAULT;1.1;AES256
36393466663530663832326138373032333162303465386232666666643638646130303137366137
6137666236326535653833333234373237343936613331340a383331316661363235323737336239
35313137363135336663326139383730336265613532353038303633346337313964643666346538
6363333135363636350a623231333466643832636463383635663564623636633931353861373938
31663065653239396361386539323035663065656332383738303733313365376234376532363235
64393030303066363362626234626334623062306632626231353965333361373036633463363432
62653336663163336666616566653065656236613736663736393530316263636638633130396264
35333465623035633165366131386230363137366537386534646334373537376563343662323134
37643633303237616466383633363338383831386136666231363332323334613061366230326430
31313661616266373233653461613237633934306363316664313365333937626163623764333039
63646336383939313362303630333863373630626361333135623137323463333431663366396565
34353865393865363737316233363131393432333363306365613037653736343433646561613937
64393663353432363736646535386263666266376231376532356430363761636266663332346530
65633634653730396639393933386434326130313165663437373939633132393031373661653530
33616464633335643666616465633964336461613436303231643636333035656366333931636365
31353261376431613431323563333137633165613033343937353162393161353433396137633232
3239
ansadmin@svl200:~$ ansible-vault decrypt hello.yaml
Vault password:
Decryption successful
ansadmin@svl200:~$ cat hello.yaml
---
- name: play with vault
    hosts: all
    become: true

    vars:
          - user: ofi03
          - port: 80

    tasks:
          - name: echo variable
              debug:
                  msg: "L'utilisateur {{user}} utilise le port {{port}} sur la
machine {{ansible_host

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim play-vars.yaml
ansadmin@svl200:~$ ansible-playbook play-vars.yaml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [Affichage nom distribution et version]


***********************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "template error while templating string:
expected        int statement', got 'distribution'. String: Le nom de la distribution
est {{ansible distribu        ion est {{ansible_version}}"}
fatal: [141.95.160.133]: FAILED! => {"msg": "template error while templating string:
expecte        rint statement', got 'distribution'. String: Le nom de la distribution
est {{ansible distrib        sion est {{ansible_version}}"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                red=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                red=0

ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-vault create play-vars.yml
New Vault password:
Confirm New Vault password:
ansadmin@svl200:~$ cat play-vars.yaml >> play-vars.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [Affichage nom distribution et version]
***********************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "template error while templating string:
expected        int statement', got 'distribution'. String: Le nom de la distribution
est {{ansible distribu        ion est {{ansible_version}}"}
fatal: [141.95.160.133]: FAILED! => {"msg": "template error while templating string:
expecte        rint statement', got 'distribution'. String: Le nom de la distribution
est {{ansible distrib        sion est {{ansible_version}}"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                red=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                red=0

ansadmin@svl200:~$ sudo vim play-vars.yml


ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***********************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full        r': 2, 'minor': 9, 'revision': 6}"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full        r': 2, 'minor': 9, 'revision': 6}"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                red=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                red=0

ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***********************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full        r': 2, 'minor': 9, 'revision': 6}"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full        r': 2, 'minor': 9, 'revision': 6}"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                red=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                red=0

ansadmin@svl200:~$ sudo vim play-vars.yml


ansadmin@svl200:~$ ansible ansiblecli -m setup | grep "version"
[WARNING]: Could not match supplied host pattern, ignoring: ansiblecli
[WARNING]: No hosts matched, nothing to do
ansadmin@svl200:~$ ansible ansiblecli -m setup | grep "version"
[WARNING]: Could not match supplied host pattern, ignoring: ansiblecli
[WARNING]: No hosts matched, nothing to do
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***********************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full        r': 2, 'minor': 9, 'revision': 6}"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est {'string':
'2.9.6', 'full        r': 2, 'minor': 9, 'revision': 6}"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                red=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                red=0

ansadmin@svl200:~$ sudo vim play-vars.yml


ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:

PLAY [Affichage d'une variable globale]


****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [Affichage nom distribution et version]


***********************************************
ok: [146.59.158.16] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est 20"
}
ok: [141.95.160.133] => {
        "msg": "Le nom de la distribution est Ubuntu et la version est 20"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                red=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                red=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ cat play-vars.yml >> locale.yml
-bash: locale.yml: Permission denied
ansadmin@svl200:~$ sudo cat play-vars.yml >> locale.yml
-bash: locale.yml: Permission denied
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ ansible-playbook locale.yml
ERROR! Syntax Error while loading YAML.
    found unacceptable key (unhashable type: 'AnsibleMapping')

The error appears to be in '/home/ansadmin/locale.yml': line 12, column 15, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

            debug:
                msg: {{port_http}}
                            ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ ansible-playbook locale.yml

PLAY [Affichage d'une variable locale]


*****************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var locale port]


*********************************************************************
ok: [146.59.158.16] => {
        "msg": 8080
}
ok: [141.95.160.133] => {
        "msg": 8080
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                red=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                red=0

ansadmin@svl200:~$ sudo vim locale.yml


ansadmin@svl200:~$ sudo vim play-vars.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ ansible-playbook var_dic.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/var_dic.yml': line 13, column 32, but m   


ay
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                        debug:
                            msg: "{{service["name"]    {{service.rpm}}"
                                                              ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ ansible-playbook var_dic.yml

PLAY [variable locale de type dictionnaire] **************************************

TASK [Gathering Facts] ***********************************************************


ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var dict] ******************************************************************


ok: [146.59.158.16] => {
        "msg": "apache et httpd"
}
ok: [141.95.160.133] => {
        "msg": "apache et httpd"
}

PLAY RECAP ***********************************************************************


141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        ski                            pped=0        rescued=0       
ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        ski                            pped=0        rescued=0       
ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ cp var_dic.yml var_dic1.yml
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (rpm). Using last defined value only.

PLAY [variable locale de type dictionnaire] **************************************

TASK [Gathering Facts] ***********************************************************


ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var dict] ******************************************************************


fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an un   
defined variable. The error was: 'None' has no attribute 'name'\n\nThe error appea   
rs to be in '/home/ansadmin/var_dic1.yml': line 15, column 13, but may\nbe elsewhe   
re in the file depending on the exact syntax problem.\n\nThe offending line appear   
s to be:\n\n    tasks:\n                    - name: var dict\n                       
^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an u   
ndefined variable. The error was: 'None' has no attribute 'name'\n\nThe error appe   
ars to be in '/home/ansadmin/var_dic1.yml': line 15, column 13, but may\nbe elsewh   
ere in the file depending on the exact syntax problem.\n\nThe offending line appea   
rs to be:\n\n    tasks:\n                    - name: var dict\n                     
^ here\n"}

PLAY RECAP ***********************************************************************


141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        ski                            pped=0        rescued=0       
ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        ski                            pped=0        rescued=0       
ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    found unexpected end of stream

The error appears to be in '/home/ansadmin/var_dic1.yml': line 20, column 1, but m   


ay
be elsewhere in the file depending on the exact syntax problem.

(specified line no longer in file, maybe it changed?)


ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14, found a duplicate dict key (rpm). Using last defined value only.

PLAY [variable locale de type dictionnaire]


********************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [var dict]


************************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "template error while templating string:
unex                pected '}'. String: {{service[type]['name']}} et {{service[type]
['rpm']}"}
fatal: [141.95.160.133]: FAILED! => {"msg": "template error while templating string:
une                xpected '}'. String: {{service[type]['name']}} et {{service[type]
['rpm']}"}

PLAY RECAP
*****************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14,
found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column 14,
found a duplicate dict key (rpm). Using last defined value only.
ERROR! conflicting action statements: debug, msg

The error appears to be in '/home/ansadmin/var_dic1.yml': line 15, column 9, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
            - name: var dict
                ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column
14, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic1.yml, line 8,
column
14, found a duplicate dict key (rpm). Using last defined value only.
ERROR! conflicting action statements: debug, msg

The error appears to be in '/home/ansadmin/var_dic1.yml': line 15, column 5, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    tasks:
    - name: var dict
        ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/var_dic1.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

                  name: mariadb
                    rpm: mariadb-server
                          ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [variable dictionnaire]
***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service apache    httpd"
}
ok: [141.95.160.133] => {
        "msg": "Le service apache    httpd"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic1.yml


ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service apache era installé par le paquethttpd"
}
ok: [141.95.160.133] => {
        "msg": "Le service apache era installé par le paquethttpd"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [variable dictionnaire]
***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb era installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb era installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic1.yml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
ok: [146.59.158.16] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}
ok: [141.95.160.133] => {
        "msg": "Le service mariadb sera installé par le paquetmariadb-server"
}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2        changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2        changed=0        unreachable=0
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$ sudo vim var_dic1.yml


ansadmin@svl200:~$ ansible-playbook var_dic1.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/var_dic1.yml': line 11, column 9, but may


be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


                    rpm: httpd
                db:
                ^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire]


***************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined va        riable. The error was: 'list object' has no attribute 'db'\n\nThe
error appears to be in '/h        ome/ansadmin/var_dic1.yml': line 16, column 5, but
may\nbe elsewhere in the file depending o        n the exact syntax problem.\n\nThe
offending line appears to be:\n\n    tasks:\n    - name: vari        able
dictionnaire\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined v        ariable. The error was: 'list object' has no attribute 'db'\n\nThe
error appears to be in '/        home/ansadmin/var_dic1.yml': line 16, column 5, but
may\nbe elsewhere in the file depending          on the exact syntax problem.\n\nThe
offending line appears to be:\n\n    tasks:\n    - name: var        iable
dictionnaire\n        ^ here\n"}

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=1        changed=0        unreachable=0 
failed=1        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=1        changed=0        unreachable=0
failed=1        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml

PLAY [variable locale de type dictionnaire]


************************************************

TASK [Gathering Facts] **************************with_dict: "{{users}}"


ansadmin@svl200:~$ head var_dic_multi3.yml
---
- name: variable locale de type dictionnaire multi dimensions
    hosts: all
    become: true
    vars_files:
        - /home/ansadmin/vars_multi.yml

    tasks:
    - name: variable dictionnaire MultiDim
        user:
ansadmin@svl200:~$ head -n20 var_dic_multi3.yml
---
- name: variable locale de type dictionnaire multi dimensions
    hosts: all
    become: true
    vars_files:
        - /home/ansadmin/vars_multi.yml

    tasks:
    - name: variable dictionnaire MultiDim
        user:
                name: "{{item.key}}"
                group: "{{item.value.group}}"
                state: "{{item.value.state}}"
        ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

ansadmin@svl200:~$ head -n30 var_dic_multi3.yml
---
- name: variable locale de type dictionnaire multi dimensions
    hosts: all
    become: true
    vars_files:
        - /home/ansadmin/vars_multi.yml

    tasks:
    - name: variable dictionnaire MultiDim
        user:
                name: "{{item.key}}"
                group: "{{item.value.group}}"
                state: "{{item.value.state}}"
        ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
ansadmin@svl200:~$ ^C
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ rm    var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml^C
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml

PLAY [variable locale de type dictionnaire multi dimensions]


*******************************

TASK [Gathering Facts]


*********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [variable dictionnaire MultiDim]


******************************************************
ok: [146.59.158.16] => (item={'key': 'antoine', 'value': {'group': 'users', 'state':
'presen        t'}})
ok: [141.95.160.133] => (item={'key': 'antoine', 'value': {'group': 'users', 'state':
'prese        nt'}})
ok: [146.59.158.16] => (item={'key': 'erwan', 'value': {'group': 'users', 'state':
'present'        }})
ok: [141.95.160.133] => (item={'key': 'erwan', 'value': {'group': 'users', 'state':
'present        '}})
ok: [146.59.158.16] => (item={'key': 'philippe', 'value': {'group': 'users', 'state':
'absen        t'}})
ok: [141.95.160.133] => (item={'key': 'philippe', 'value': {'group': 'users',
'state': 'abse        nt'}})

PLAY RECAP
*********************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0                rescued=0        ignored=0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim vars.yml
ansadmin@svl200:~$ cp vim vars.yml vars2.yml
cp: target 'vars2.yml' is not a directory
ansadmin@svl200:~$ sudo vim vars2.yml
ansadmin@svl200:~$ cp vars.yml vars2.yml
ansadmin@svl200:~$ sudo vim vars2.yml
ansadmin@svl200:~$ cp var_dic_multi3.yml var_dic_multi4.yml
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ls
cible1.txt      fact1.yaml            item_users.yaml      rep.yaml                 
var_dic_multi4.yml
copie.yaml      handler.yaml        items.yaml                seq.yaml               
vars.yml
debug.yaml      hello.yaml            items_users.yaml    shell.yml                 
vars2.yml
debug1.yaml    hello.yml              list.yaml                  template.yaml       
vars_multi.yml
exo2.yaml        index.html            locale.yml                template1.yaml     
when.yaml
exo3.yaml        index.html.j2      nginx.yaml                var_dic.yml           
when1.yaml
exo4.yaml        index.html1.j2    play-vars.yaml        var_dic2.yml
fact.yaml        ip.txt                    play-vars.yml          var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab: 'item' is undefined\n\nThe error appears to be in
'/home/ansadmin/var_dic_multi4.yml': line 9,y\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appearss:\n    - name: dictionnaire
service\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined varias: 'item' is undefined\n\nThe error appears to be in
'/home/ansadmin/var_dic_multi4.yml': line 9ay\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appearks:\n    - name: dictionnaire
service\n        ^ here\n"}
PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ sudo vim vars2.yml
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/var_dic_multi4.yml': line 13, column 29,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              state: latest
              when: "{{item.key}}" == "{{service[type]['name']}}"
                                                        ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab: 'item' is undefined\n\nThe error appears to be in
'/home/ansadmin/var_dic_multi4.yml': line 9,y\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appearss:\n    - name: dictionnaire
service\n        ^ here\n"}
fatal: [141.95.160.133]: FAILED! => {"msg": "The task includes an option with an
undefined varias: 'item' is undefined\n\nThe error appears to be in
'/home/ansadmin/var_dic_multi4.yml': line 9ay\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appearks:\n    - name: dictionnaire
service\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/var_dic_multi4.yml': line 13, column 26,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              state: latest
              when: "type==web" and "ansible_os_family=Debian"
                                                  ^ here
We could be wrong, but this one looks like it might be an issue with
unbalanced quotes. If starting a value with a quote, make sure the
line ends with the same set of quotes. For instance this arbitrary
example:

        foo: "bad" "wolf"

Could be written as:

        foo: '"bad" "wolf"'


ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************
TASK [Gathering Facts]
*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}
PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ q

Command 'q' not found, but can be installed with:

snap install q                                              # version 1.6.3-1, or


apt    install python3-q-text-as-data    # version 1.7.4+2018.12.21+git+28f776ed46-2

See 'snap info q' for additional versions.

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) mrted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dekg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purge,che, upgrade"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt) orted parameters include: allow_unauthenticated, autoclean, autoremove,
cache_valid_time, deb, dpkg_options, force, force_apt_get, install_recommends,
only_upgrade, package, policy_rc_d, purgeache, upgrade"}
PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc0

ansadmin@svl200:~$ sudo vim vars2.yml


ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (when). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=0        skipped=1      resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=0        skipped=1      resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml --extra-vars "type=web"
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (when). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
TASK [dictionnaire service]
********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=0        skipped=1      resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=0        skipped=1      resc0

ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml --extra-vars "type=db"


[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (apt). Using last defined value only.
[WARNING]: While constructing a mapping from /home/ansadmin/var_dic_multi4.yml, line
9, column 5
duplicate dict key (when). Using last defined value only.

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [dictionnaire service]


********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=0        skipped=1      resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=0        skipped=1      resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml --extra-vars "type=db"

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=0        skipped=2      resc0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=0        skipped=2      resc0

ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml --extra-vars "type=web"

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc0

ansadmin@svl200:~$ sudo vim var_dic_multi4.yml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml --extra-vars "type=web"

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc0

ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim group.yml
ansadmin@svl200:~$ mv vim group.yml inventory.yaml
mv: target 'inventory.yaml' is not a directory
ansadmin@svl200:~$ mv group.yml inventory.yaml
ansadmin@svl200:~$ sudo vim inventory.yaml
ansadmin@svl200:~$ ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
[WARNING]: Skipping key (ansible_port) in group (vars) as it is not a mapping, it is
a <class 'i

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hostnnect to host 146.59.158.16 port 22: Connection refused", "unreachable":
true}
fatal: [141.95.160.133]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hosonnect to host 141.95.160.133 port 22: Connection refused", "unreachable":
true}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0        resc0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0        resc0

ansadmin@svl200:~$ sudo vim inventory.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
[WARNING]: Skipping key (ansible_port) in group (vars) as it is not a mapping, it is
a <class 'i

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************
TASK [Gathering Facts]
*************************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hostnnect to host 146.59.158.16 port 22: Connection refused", "unreachable":
true}
fatal: [141.95.160.133]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hosonnect to host 141.95.160.133 port 22: Connection refused", "unreachable":
true}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0        resc0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0        resc0

ansadmin@svl200:~$ sudo vim inventory.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc0

ansadmin@svl200:~$ sudo vim inventory.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************
TASK [Gathering Facts]
*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
ok: [141.95.160.133]
ok: [146.59.158.16]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc

ansadmin@svl200:~$ sudo vim inventory.yaml


ansadmin@svl200:~$
ansadmin@svl200:~$ tree
.
├── cible1.txt
├── copie.yaml
├── debug.yaml
├── debug1.yaml
├── exo2.yaml
├── exo3.yaml
├── exo4.yaml
├── fact.yaml
├── fact1.yaml
├── handler.yaml
├── hello.yaml
├── hello.yml
├── index.html
├── index.html.j2
├── index.html1.j2
├── inventory.yaml
├── ip.txt
├── item_users.yaml
├── items.yaml
├── items_users.yaml
├── list.yaml
├── locale.yml
├── nginx.yaml
├── play-vars.yaml
├── play-vars.yml
├── rep.yaml
├── seq.yaml
├── shell.yml
├── snap
│   └── tree
│            ├── 18
│            ├── common
│            └── current -> 18
├── template.yaml
├── template1.yaml
├── var_dic.yml
├── var_dic2.yml
├── var_dic_multi3.yml
├── var_dic_multi4.yml
├── vars.yml
├── vars2.yml
├── vars_multi.yml
├── when.yaml
└── when1.yaml

5 directories, 39 files
ansadmin@svl200:~$
ansadmin@svl200:~$ mkdir host_vars
ansadmin@svl200:~$ mkdir group_vars
ansadmin@svl200:~$ mkdir projet
ansadmin@svl200:~$ mv inventory.yaml var_dic_multi4.yml host_vars group_vars projet/
ansadmin@svl200:~$ cd projet/
ansadmin@svl200:~/projet$ ls
group_vars    host_vars    inventory.yaml    var_dic_multi4.yml
ansadmin@svl200:~/projet$ cd
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim vars2.yml
ansadmin@svl200:~$ cp vars2.yml projet/
ansadmin@svl200:~$
ansadmin@svl200:~$ cd projet/
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ls -lrt
total 20
-rw-r--r-- 1 ansadmin ansadmin    617 Oct    5 09:45 var_dic_multi4.yml
-rw-r--r-- 1 root          root            159 Oct    5 10:20 inventory.yaml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 host_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 group_vars
-rw-r--r-- 1 ansadmin ansadmin    149 Oct    5 10:26 vars2.yml
ansadmin@svl200:~/projet$ mv var_dic_multi4.yml install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ls -lrt
total 20
-rw-r--r-- 1 ansadmin ansadmin    617 Oct    5 09:45 install.yaml
-rw-r--r-- 1 root          root            159 Oct    5 10:20 inventory.yaml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 host_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 group_vars
-rw-r--r-- 1 ansadmin ansadmin    149 Oct    5 10:26 vars2.yml
ansadmin@svl200:~/projet$ mv vars2.yml vars_install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ls -lrt
total 20
-rw-r--r-- 1 ansadmin ansadmin    617 Oct    5 09:45 install.yaml
-rw-r--r-- 1 root          root            159 Oct    5 10:20 inventory.yaml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 host_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 group_vars
-rw-r--r-- 1 ansadmin ansadmin    149 Oct    5 10:26 vars_install.yaml
ansadmin@svl200:~/projet$ sudo vim inventory.yaml
ansadmin@svl200:~/projet$ sudo vim inventory.yaml
ansadmin@svl200:~/projet$ cd group_vars/
ansadmin@svl200:~/projet/group_vars$ sudo vim port.yaml
ansadmin@svl200:~/projet/group_vars$ mv port.yaml cible1.yaml
ansadmin@svl200:~/projet/group_vars$ cp cible1.yaml cible2.yaml
ansadmin@svl200:~/projet/group_vars$
ansadmin@svl200:~/projet/group_vars$ cd ..
ansadmin@svl200:~/projet$ tree
.
├── group_vars
│   ├── cible1.yaml
│   └── cible2.yaml
├── host_vars
├── install.yaml
├── inventory.yaml
└── vars_install.yaml

2 directories, 5 files
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml var_dic_multi4.yml --
extra-vars "ty
ERROR! the playbook: var_dic_multi4.yml could not be found
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      resc

ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ sudo vim
group_vars/                host_vars/                  install.yaml             
inventory.yaml          vars_install.yaml
ansadmin@svl200:~/projet$ sudo vim inventory.yaml
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ls -lrt
total 20
-rw-r--r-- 1 ansadmin ansadmin    617 Oct    5 09:45 install.yaml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:21 host_vars
-rw-r--r-- 1 ansadmin ansadmin    149 Oct    5 10:26 vars_install.yaml
-rw-r--r-- 1 root          root            171 Oct    5 10:30 inventory.yaml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:32 group_vars
ansadmin@svl200:~/projet$ cd group_vars/
ansadmin@svl200:~/projet/group_vars$ ls
cible1.yaml    cible2.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible1.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible2.yaml
ansadmin@svl200:~/projet/group_vars$ ls -lrt
ansadmin@svl200:~/projet/group_vars$ ansible-playbook -i inventory.yaml install.yaml
--extra-varERROR! the playbook: install.yaml could not be found
ansadmin@svl200:~/projet/group_vars$ cd
ansadmin@svl200:~$ cd projet/
ansadmin@svl200:~/projet$ ls
group_vars    host_vars    install.yaml    inventory.yaml    vars_install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the host: connect to host 146.59.158.16 port 2222: Connection refused",
"unreachable": true}
fatal: [141.95.160.133]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hosh: connect to host 141.95.160.133 port 2222: Connection refused",
"unreachable": true}

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0        rescred=0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0        rescred=0

ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ cd projet/
-bash: cd: projet/: No such file or directory
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ cd group_vars/
ansadmin@svl200:~/projet/group_vars$ sudo vim cible1.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible2.yaml
ansadmin@svl200:~/projet/group_vars$ cd ..
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
PLAY [variable locale de type dictionnaire (service) multi dimensions]
*************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install webserver]


***********************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [install dbserver]


************************************************************************
skipping: [146.59.158.16]
skipping: [141.95.160.133]

PLAY RECAP
*************************************************************************************
141.95.160.133                          : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      rescred=0
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=1      rescred=0

ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ sudo vim client1.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client2.yaml
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ ls
client1.yaml    client2.yaml
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ sudo vim inventory.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/projet/install.yaml': line 26, column 18,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              msg: " var est {{vars5}}


              #              ("{{item.key}}" == "{{service[type]['name']}}")
                                  ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 16, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              #              ("{{item.key}}" == "{{service[type]['name']}}")
    - name: install dbserver
        ^ here
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ sudo vim client1.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client2.yaml
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 16, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              #              ("{{item.key}}" == "{{service[type]['name']}}")
    - name: install dbserver
        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 16, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              #              ("{{item.key}}" == "{{service[type]['name']}}")
    - name: install dbserver
        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ ls
client1.yaml    client2.yaml
ansadmin@svl200:~/projet/host_vars$ ll
total 16
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 10:49 ./
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct    5 10:51 ../
-rw-r--r-- 1 root          root              13 Oct    5 10:49 client1.yaml
-rw-r--r-- 1 root          root              12 Oct    5 10:49 client2.yaml
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ cd
group_vars/ host_vars/
ansadmin@svl200:~/projet$ cd group_vars/
ansadmin@svl200:~/projet/group_vars$ ls
cible1.yaml    cible2.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible1.yaml
ansadmin@svl200:~/projet/group_vars$
ansadmin@svl200:~/projet/group_vars$ cd ..
ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ ls
client1.yaml    client2.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client1.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client2.yaml
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 16, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              #              ("{{item.key}}" == "{{service[type]['name']}}")
    - name: install dbserver
        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 16, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

              #              ("{{item.key}}" == "{{service[type]['name']}}")
    - name: install dbserver
        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug
The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,
but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! 'debug' is not a valid attribute for a Play

The error appears to be in '/home/ansadmin/projet/install.yaml': line 2, column 3,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: variable locale de type dictionnaire (service) multi dimensions
    ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/projet/install.yaml': line 23, column 6,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

          debug:
          ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ cd
ansadmin@svl200:~$ sudo vim
.ansible/                      copie.yaml                    hello.yml               
nginx.yaml                    var_dic.yml
.bash_history              debug.yaml                    index.html                 
play-vars.yaml            var_dic2.yml
.bash_logout                debug1.yaml                  index.html.j2             
play-vars.yml              var_dic_multi3.y
.bashrc                          exo2.yaml                      index.html1.j2       
projet/                          vars.yml
.exo4.yaml.swp            exo3.yaml                      ip.txt                     
rep.yaml                        vars2.yml
.handler.yaml.swp      exo4.yaml                      item_users.yaml         
seq.yaml                        vars_multi.yml
.profile                        fact.yaml                      items.yaml           
shell.yml                      when.yaml
.ssh/                              fact1.yaml                    items_users.yaml   
snap/                              when1.yaml
.viminfo                        handler.yaml                list.yaml               
template.yaml
cible1.txt                    hello.yaml                    locale.yml               
template1.yaml
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ cd projet/
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim
group_vars/                host_vars/                  install.yaml             
inventory.yaml          vars_install.yaml
ansadmin@svl200:~/projet$ sudo vim inventory.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ cd
group_vars/ host_vars/
ansadmin@svl200:~/projet$ cd group_vars/
ansadmin@svl200:~/projet/group_vars$ ls
cible1.yaml    cible2.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible1.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible2.yaml
ansadmin@svl200:~/projet/group_vars$ ansible-playbook -i inventory.yaml install.yaml
--extra-var
ERROR! the playbook: install.yaml could not be found
ansadmin@svl200:~/projet/group_vars$ cd ..
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ ls
client1.yaml    client2.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client1.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client2.yaml
ansadmin@svl200:~/projet/host_vars$ ansible-playbook -i inventory.yaml install.yaml
--extra-vars
ERROR! the playbook: install.yaml could not be found
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet/install.yaml': line 16, column 9,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


          apt:
                ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sd not resolve hostname client1: Temporary failure in name resolution",
"unreachable": true}
fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sd not resolve hostname client2: Temporary failure in name resolution",
"unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        rescred=0
client2                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        rescred=0

ansadmin@svl200:~/projet$ cd host_vars/
ansadmin@svl200:~/projet/host_vars$ ls
client1.yaml    client2.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client1.yaml
ansadmin@svl200:~/projet/host_vars$ sudo vim client2.yaml
ansadmin@svl200:~/projet/host_vars$ cd ..
ansadmin@svl200:~/projet$ cd group_vars/
ansadmin@svl200:~/projet/group_vars$ ls
cible1.yaml    cible2.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible1.yaml
ansadmin@svl200:~/projet/group_vars$ sudo vim cible2.yaml
ansadmin@svl200:~/projet/group_vars$
ansadmin@svl200:~/projet/group_vars$ cd ..
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sd not resolve hostname client1: Temporary failure in name resolution",
"unreachable": true}
fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sd not resolve hostname client2: Temporary failure in name resolution",
"unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        rescred=0
client2                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        rescred=0

ansadmin@svl200:~/projet$ sudo vim install.yaml


ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! conflicting action statements: apt, debug

The error appears to be in '/home/ansadmin/projet/install.yaml': line 15, column 5,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: install dbserver


        ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! Syntax Error while loading YAML.
    did not find expected key

The error appears to be in '/home/ansadmin/projet/install.yaml': line 23, column 4,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

      debug:
      ^ here
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet/install.yaml': line 23, column 15,


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


                  debug:
                            ^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web

PLAY [variable locale de type dictionnaire (service) multi dimensions]


*************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sd not resolve hostname client1: Temporary failure in name resolution",
"unreachable": true}
fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sd not resolve hostname client2: Temporary failure in name resolution",
"unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        rescred=0
client2                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        rescred=0

ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ ll
total 28
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct    5 11:47 ./
drwxr-xr-x 6 ansadmin ansadmin 4096 Oct    5 11:29 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 11:43 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 11:40 host_vars/
-rw-r--r-- 1 ansadmin ansadmin    563 Oct    5 11:47 install.yaml
-rw-r--r-- 1 root          root            158 Oct    5 11:31 inventory.yaml
-rw-r--r-- 1 ansadmin ansadmin    149 Oct    5 10:26 vars_install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ tree
.
├── group_vars
│   ├── cible1.yaml
│   └── cible2.yaml
├── host_vars
│   ├── client1.yaml
│   └── client2.yaml
├── install.yaml
├── inventory.yaml
└── vars_install.yaml

2 directories, 7 files
ansadmin@svl200:~/projet$ cd
ansadmin@svl200:~$
ansadmin@svl200:~$ mkdir projet1
ansadmin@svl200:~$ cd projet1
ansadmin@svl200:~/projet1$ mkdir roles
ansadmin@svl200:~/projet1$ cd roles/
ansadmin@svl200:~/projet1/roles$ mkdir apache
ansadmin@svl200:~/projet1/roles$ cd apache/
ansadmin@svl200:~/projet1/roles/apache$ tree
.

0 directories, 0 files
ansadmin@svl200:~/projet1/roles/apache$ pwd
/home/ansadmin/projet1/roles/apache
ansadmin@svl200:~/projet1/roles/apache$ mkdir tasks vars templates handlers
ansadmin@svl200:~/projet1/roles/apache$ tree
.
├── handlers
├── tasks
├── templates
└── vars

4 directories, 0 files
ansadmin@svl200:~/projet1/roles/apache$ touch tasks/main.yml
ansadmin@svl200:~/projet1/roles/apache$ touch vars/main.yml
ansadmin@svl200:~/projet1/roles/apache$ touch handlers/main.yml
ansadmin@svl200:~/projet1/roles/apache$ tree
.
├── handlers
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
└── vars
        └── main.yml

4 directories, 3 files
ansadmin@svl200:~/projet1/roles/apache$ sudo vim tasks/main.yml
ansadmin@svl200:~/projet1/roles/apache$ sudo vim handlers/main.yml
ansadmin@svl200:~/projet1/roles/apache$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/apache$ sudo vim t
tasks/          templates/
ansadmin@svl200:~/projet1/roles/apache$ sudo vim templates/index.html.j2
ansadmin@svl200:~/projet1/roles/apache$ cd ..
ansadmin@svl200:~/projet1/roles$ cd ..
ansadmin@svl200:~/projet1$ sudo vim hosts.yml
ansadmin@svl200:~/projet1$ sudo vim site.yml
ansadmin@svl200:~/projet1$ sudo vim templates/index.html.j2
ansadmin@svl200:~/projet1$ cd roles/apache
ansadmin@svl200:~/projet1/roles/apache$ sudo vim templates/index.html.j2
ansadmin@svl200:~/projet1/roles/apache$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/apache$
ansadmin@svl200:~/projet1/roles/apache$ cd ..
ansadmin@svl200:~/projet1/roles$ cd ..
ansadmin@svl200:~/projet1$ ansible-playbook -i
hosts.yml    roles/          site.yml
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the
implicit loc
PLAY [install apache]
**************************************************************************
skipping: no hosts matched

PLAY RECAP
*************************************************************************************

ansadmin@svl200:~/projet1$ sudo vim hosts.yml


ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sclient1: Temporary failure in name resolution", "unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/projet1$ tree
.
├── hosts.yml
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

6 directories, 6 files
ansadmin@svl200:~/projet1$ curl client1
curl: (6) Could not resolve host: client1
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ tree
.
├── hosts.yml
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

6 directories, 6 files
ansadmin@svl200:~/projet1$ mkdir group_vars
ansadmin@svl200:~/projet1$ mkdir hosts_vars
ansadmin@svl200:~/projet1$ cat roles/apache/tasks/main.yml
---
- name: install apache
    apt:
      name: apache2
      state: latest

- name: copy index


    template:
              src: index.html.j2
              dest: /var/www/html/index.html
    notify: restart_apache
ansadmin@svl200:~/projet1$ cat roles/apache/handlers/main.yml
---
- name: restart_apache
    systemd:
          name: apache2
          state: restarted

ansadmin@svl200:~/projet1$ cat roles/apache/vars/main.yml


---
- file_version: 5
ansadmin@svl200:~/projet1$ cat roles/apache/templates/index.html.j2
Je suis un fichier de test
Je suis deploye sur le serveur {{ansible_hostname}} avec apache version
{{file_version}}
ansadmin@svl200:~/projet1$ sudo vim site.yml
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 5}]
ansadmin@svl200:~/projet1$ sudo vim roles/apache/vars/main.yml
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$ sudo vim roles/apache/vars/main.yml
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ tree
.
├── group_vars
├── hosts.yml
├── hosts_vars
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 6 files
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$ cat roles/apache/templates/index.html.j2
Je suis un fichier de test
Je suis deploye sur le serveur {{ansible_hostname}} avec apache version
{{file_version}}
ansadmin@svl200:~/projet1$ sudo vim roles/apache/vars/main.yml
ansadmin@svl200:~/projet1$ cat roles/apache/templates/index.html.j2
Je suis un fichier de test
Je suis deploye sur le serveur {{ansible_hostname}} avec apache version
{{file_version}}
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$ sudo vim roles/apache/
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~/projet1$ sudo vim roles/apache/tasks/main.yml
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ tree
.
├── group_vars
├── hosts.yml
├── hosts_vars
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 6 files
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml
ERROR! failed to combine variables, expected dicts but got a 'dict' and a
'AnsibleSequence':
{}
[{"file_version": 4.42}]
ansadmin@svl200:~/projet1$ sudo vim roles/apache/vars/main.yml
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via sclient1: Temporary failure in name resolution", "unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/projet1$ cd
ansadmin@svl200:~$ sudo vim /etc/hosts
ansadmin@svl200:~$
ansadmin@svl200:~$ cd projet1/
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via st 22: Connection refused", "unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/projet1$ tree
.
├── group_vars
├── hosts.yml
├── hosts_vars
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 6 files
ansadmin@svl200:~/projet1$ cat hosts
hosts.yml      hosts_vars/
ansadmin@svl200:~/projet1$ cat hosts
hosts.yml      hosts_vars/
ansadmin@svl200:~/projet1$ cat hosts.yml
all:
      children:
                cible1:
                      hosts:
                        client1:
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via st 22: Connection refused", "unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/projet1$ cd
ansadmin@svl200:~$ sudo vim /etc/hosts
ansadmin@svl200:~$ cd projet1/
ansadmin@svl200:~/projet1$ ansible -i
group_vars/ hosts.yml      hosts_vars/ roles/            site.yml
ansadmin@svl200:~/projet1$ ansible -i hosts.yml client1 -m ping
client1 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: ssh: connect to host client1
port 22: Connect
        "unreachable": true
}
ansadmin@svl200:~/projet1$ cd roles/
ansadmin@svl200:~/projet1/roles$ ls
apache
ansadmin@svl200:~/projet1/roles$ cd apache/
ansadmin@svl200:~/projet1/roles/apache$ ls
handlers    tasks    templates    vars
ansadmin@svl200:~/projet1/roles/apache$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/apache$ sudo vim
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~/projet1/roles/apache$ sudo vim handlers/main.yml
ansadmin@svl200:~/projet1/roles/apache$ sudo vim templates/
ansadmin@svl200:~/projet1/roles/apache$ sudo vim templates/index.html.j2
ansadmin@svl200:~/projet1/roles/apache$
ansadmin@svl200:~/projet1/roles/apache$ sudo vim
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~/projet1/roles/apache$ sudo vim
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~/projet1/roles/apache$ cd ..
ansadmin@svl200:~/projet1/roles$ ll
total 12
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct    5 12:14 ./
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct    5 12:39 ../
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct    5 12:15 apache/
ansadmin@svl200:~/projet1/roles$ cd ..
ansadmin@svl200:~/projet1$ ll
total 28
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct    5 12:39 ./
drwxr-xr-x 7 ansadmin ansadmin 4096 Oct    5 12:13 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 12:37 group_vars/
-rw-r--r-- 1 root          root              73 Oct    5 12:33 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 12:37 hosts_vars/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct    5 12:14 roles/
-rw-r--r-- 1 root          root              80 Oct    5 12:39 site.yml
ansadmin@svl200:~/projet1$ sudo vim site.yml
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via st 22: Connection refused", "unreachable": true}

PLAY RECAP
*************************************************************************************
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible -i hosts.yml client1 -m ping
client1 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: ssh: connect to host client1
port 22: Connect
        "unreachable": true
}
ansadmin@svl200:~/projet1$ tree
.
├── group_vars
├── hosts.yml
├── hosts_vars
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 6 files
ansadmin@svl200:~/projet1$ cd group_vars/
ansadmin@svl200:~/projet1/group_vars$ ls
ansadmin@svl200:~/projet1/group_vars$ sudo vim all.yml
ansadmin@svl200:~/projet1/group_vars$ cd ..
ansadmin@svl200:~/projet1$ ansible -i hosts.yml client1 -m ping
The authenticity of host '[client1]:55600 ([146.59.158.16]:55600)' can't be
established.
ECDSA key fingerprint is SHA256:aQH+1UeVJklKq8A45Soa63iOGGkNRC/op7o5MgPiJtc.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
client1 | SUCCESS => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "ping": "pong"
}
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible -i hosts.yml client1 -m ping
client1 | SUCCESS => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "ping": "pong"
}
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client1]

TASK [apache : install apache]


*****************************************************************
ok: [client1]

TASK [apache : copy index]


*********************************************************************
changed: [client1]

RUNNING HANDLER [apache : restart_apache]


******************************************************
fatal: [client1]: FAILED! => {"changed": false, "msg": "Unable to start service
apache2: Job forcontrol process exited with error code.\nSee \"systemctl status
apache2.service\" and \"journalc

NO MORE HOSTS LEFT


*****************************************************************************

PLAY RECAP
*************************************************************************************
client1                                        : ok=3      changed=1     
unreachable=0        failed=1      skipped=0        resc

ansadmin@svl200:~/projet1$ cd
ansadmin@svl200:~$ ansible all -m service -a "name=nginx state= stopped"
ERROR! this task 'service' has extra params, which is only allowed in the following
mo                    dules: include_role, import_tasks, win_command, add_host,
include_vars, group_by, set_                    fact, win_shell, script,
include_tasks, command, import_role, raw, meta, include, shel                    l
ansadmin@svl200:~$ cd projet/
group_vars/ host_vars/
ansadmin@svl200:~$ cd projet1/
group_vars/ hosts_vars/ roles/
ansadmin@svl200:~$ cd projet1/roles/apache/
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~$ sudo vim projet1/roles/apache/vars/
ansadmin@svl200:~$ sudo vim projet1/roles/apache/vars/main.yml
ansadmin@svl200:~$ cd projet1
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet1$ cd group_vars/
ansadmin@svl200:~/projet1/group_vars$ sudo vim all.yml
ansadmin@svl200:~/projet1/group_vars$
ansadmin@svl200:~/projet1/group_vars$ cd ..
ansadmin@svl200:~/projet1$ ansible all -bm service -a "name=nginx state=stopped"
146.59.158.16 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "nginx",
        "state": "stopped",
        "status": {
                "ActiveEnterTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ActiveEnterTimestampMonotonic": "3302273985318",
                "ActiveExitTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ActiveExitTimestampMonotonic": "3302273891667",
                "ActiveState": "active",
                "After": "basic.target systemd-journald.socket system.slice
network.target sys                    init.target",
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "AssertTimestampMonotonic": "3302273921869",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "yes",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_f                    owner cap_fsetid cap_kill cap_setgid
cap_setuid cap_setpcap cap_linux_immutable cap_ne                    t_bind_service
cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner              
cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct
cap_sys_admin                    cap_sys_boot cap_sys_nice cap_sys_resource
cap_sys_time cap_sys_tty_config cap_mknod                     cap_lease
cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin         
cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ConditionTimestampMonotonic": "3302273921868",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlGroup": "/system.slice/nginx.service",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "A high performance web server and a reverse proxy
server",
                "DevicePolicy": "auto",
                "Documentation": "man:nginx(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "ExecMainCode": "0",
                "ExecMainExitTimestampMonotonic": "0",
                "ExecMainPID": "259389",
                "ExecMainStartTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ExecMainStartTimestampMonotonic": "3302273985272",
                "ExecMainStatus": "0",
                "ExecReload": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on; m                    aster_process on; -s reload ; ignore_errors=no ;
start_time=[n/a] ; stop_time=[n/a] ;                     pid=0 ; code=(null) ;
status=0/0 }",
                "ExecReloadEx": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on;                    master_process on; -s reload ; flags= ;
start_time=[n/a] ; stop_time=[n/a] ; pid=0 ;                     code=(null) ;
status=0/0 }",
                "ExecStart": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on; ma                    ster_process on; ; ignore_errors=no ;
start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; cod                    e=(null) ;
status=0/0 }",
                "ExecStartEx": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on;                     master_process on; ; flags= ; start_time=[n/a] ;
stop_time=[n/a] ; pid=0 ; code=(null)                    ; status=0/0 }",
                "ExecStartPre": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -t -
q -g daem                    on on; master_process on; ; ignore_errors=no ;
start_time=[n/a] ; stop_time=[n/a] ; pi                    d=0 ; code=(null) ;
status=0/0 }",
                "ExecStartPreEx": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -t
-q -g da                    emon on; master_process on; ; flags= ; start_time=[n/a] ;
stop_time=[n/a] ; pid=0 ; co                    de=(null) ; status=0/0 }",
                "ExecStop": "{ path=/sbin/start-stop-daemon ; argv[]=/sbin/start-
stop-daemon -                    -quiet --stop --retry QUIT/5 --pidfile
/run/nginx.pid ; ignore_errors=yes ; start_time                    =[n/a] ;
stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }",
                "ExecStopEx": "{ path=/sbin/start-stop-daemon ; argv[]=/sbin/start-
stop-daemon                    --quiet --stop --retry QUIT/5 --pidfile
/run/nginx.pid ; flags=ignore-failure ; start                    _time=[n/a] ;
stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }",
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/nginx.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "nginx.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "yes",
                "InactiveEnterTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "InactiveEnterTimestampMonotonic": "3302273920721",
                "InactiveExitTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "InactiveExitTimestampMonotonic": "3302273924890",
                "InvocationID": "ae99bd68c38e4f0888f4fcc0fdb6e604",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "mixed",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "259389",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "3936256",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "nginx.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "PIDFile": "/run/nginx.pid",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "system.slice sysinit.target",
                "Restart": "no",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "StateChangeTimestampMonotonic": "3302273985318",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "running",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "2",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "5s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "5s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "forking",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
141.95.160.133 | CHANGED => {
        "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "nginx",
        "state": "stopped",
        "status": {
                "ActiveEnterTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ActiveEnterTimestampMonotonic": "1653327603774",
                "ActiveExitTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ActiveExitTimestampMonotonic": "1653327512824",
                "ActiveState": "active",
                "After": "system.slice sysinit.target systemd-journald.socket
network.target b                    asic.target",
                "AllowIsolate": "no",
                "AllowedCPUs": "",
                "AllowedMemoryNodes": "",
                "AmbientCapabilities": "",
                "AssertResult": "yes",
                "AssertTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "AssertTimestampMonotonic": "1653327525041",
                "Before": "shutdown.target multi-user.target",
                "BlockIOAccounting": "no",
                "BlockIOWeight": "[not set]",
                "CPUAccounting": "no",
                "CPUAffinity": "",
                "CPUAffinityFromNUMA": "no",
                "CPUQuotaPerSecUSec": "infinity",
                "CPUQuotaPeriodUSec": "infinity",
                "CPUSchedulingPolicy": "0",
                "CPUSchedulingPriority": "0",
                "CPUSchedulingResetOnFork": "no",
                "CPUShares": "[not set]",
                "CPUUsageNSec": "[not set]",
                "CPUWeight": "[not set]",
                "CacheDirectoryMode": "0755",
                "CanIsolate": "no",
                "CanReload": "yes",
                "CanStart": "yes",
                "CanStop": "yes",
                "CapabilityBoundingSet": "cap_chown cap_dac_override
cap_dac_read_search cap_f                    owner cap_fsetid cap_kill cap_setgid
cap_setuid cap_setpcap cap_linux_immutable cap_ne                    t_bind_service
cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner              
cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct
cap_sys_admin                    cap_sys_boot cap_sys_nice cap_sys_resource
cap_sys_time cap_sys_tty_config cap_mknod                     cap_lease
cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin         
cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read",
                "CleanResult": "success",
                "CollectMode": "inactive",
                "ConditionResult": "yes",
                "ConditionTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ConditionTimestampMonotonic": "1653327525041",
                "ConfigurationDirectoryMode": "0755",
                "Conflicts": "shutdown.target",
                "ControlGroup": "/system.slice/nginx.service",
                "ControlPID": "0",
                "DefaultDependencies": "yes",
                "DefaultMemoryLow": "0",
                "DefaultMemoryMin": "0",
                "Delegate": "no",
                "Description": "A high performance web server and a reverse proxy
server",
                "DevicePolicy": "auto",
                "Documentation": "man:nginx(8)",
                "DynamicUser": "no",
                "EffectiveCPUs": "",
                "EffectiveMemoryNodes": "",
                "ExecMainCode": "0",
                "ExecMainExitTimestampMonotonic": "0",
                "ExecMainPID": "168715",
                "ExecMainStartTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "ExecMainStartTimestampMonotonic": "1653327603733",
                "ExecMainStatus": "0",
                "ExecReload": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on; m                    aster_process on; -s reload ; ignore_errors=no ;
start_time=[n/a] ; stop_time=[n/a] ;                     pid=0 ; code=(null) ;
status=0/0 }",
                "ExecReloadEx": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on;                    master_process on; -s reload ; flags= ;
start_time=[n/a] ; stop_time=[n/a] ; pid=0 ;                     code=(null) ;
status=0/0 }",
                "ExecStart": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on; ma                    ster_process on; ; ignore_errors=no ;
start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; cod                    e=(null) ;
status=0/0 }",
                "ExecStartEx": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g
daemon on;                     master_process on; ; flags= ; start_time=[n/a] ;
stop_time=[n/a] ; pid=0 ; code=(null)                    ; status=0/0 }",
                "ExecStartPre": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -t -
q -g daem                    on on; master_process on; ; ignore_errors=no ;
start_time=[n/a] ; stop_time=[n/a] ; pi                    d=0 ; code=(null) ;
status=0/0 }",
                "ExecStartPreEx": "{ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -t
-q -g da                    emon on; master_process on; ; flags= ; start_time=[n/a] ;
stop_time=[n/a] ; pid=0 ; co                    de=(null) ; status=0/0 }",
                "ExecStop": "{ path=/sbin/start-stop-daemon ; argv[]=/sbin/start-
stop-daemon -                    -quiet --stop --retry QUIT/5 --pidfile
/run/nginx.pid ; ignore_errors=yes ; start_time                    =[n/a] ;
stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }",
                "ExecStopEx": "{ path=/sbin/start-stop-daemon ; argv[]=/sbin/start-
stop-daemon                    --quiet --stop --retry QUIT/5 --pidfile
/run/nginx.pid ; flags=ignore-failure ; start                    _time=[n/a] ;
stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }",
                "FailureAction": "none",
                "FileDescriptorStoreMax": "0",
                "FinalKillSignal": "9",
                "FragmentPath": "/lib/systemd/system/nginx.service",
                "GID": "[not set]",
                "GuessMainPID": "yes",
                "IOAccounting": "no",
                "IOReadBytes": "18446744073709551615",
                "IOReadOperations": "18446744073709551615",
                "IOSchedulingClass": "0",
                "IOSchedulingPriority": "0",
                "IOWeight": "[not set]",
                "IOWriteBytes": "18446744073709551615",
                "IOWriteOperations": "18446744073709551615",
                "IPAccounting": "no",
                "IPEgressBytes": "[no data]",
                "IPEgressPackets": "[no data]",
                "IPIngressBytes": "[no data]",
                "IPIngressPackets": "[no data]",
                "Id": "nginx.service",
                "IgnoreOnIsolate": "no",
                "IgnoreSIGPIPE": "yes",
                "InactiveEnterTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "InactiveEnterTimestampMonotonic": "1653327524043",
                "InactiveExitTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "InactiveExitTimestampMonotonic": "1653327527139",
                "InvocationID": "d47d8efaef624bfd94ed882646996bd0",
                "JobRunningTimeoutUSec": "infinity",
                "JobTimeoutAction": "none",
                "JobTimeoutUSec": "infinity",
                "KeyringMode": "private",
                "KillMode": "mixed",
                "KillSignal": "15",
                "LimitAS": "infinity",
                "LimitASSoft": "infinity",
                "LimitCORE": "infinity",
                "LimitCORESoft": "0",
                "LimitCPU": "infinity",
                "LimitCPUSoft": "infinity",
                "LimitDATA": "infinity",
                "LimitDATASoft": "infinity",
                "LimitFSIZE": "infinity",
                "LimitFSIZESoft": "infinity",
                "LimitLOCKS": "infinity",
                "LimitLOCKSSoft": "infinity",
                "LimitMEMLOCK": "65536",
                "LimitMEMLOCKSoft": "65536",
                "LimitMSGQUEUE": "819200",
                "LimitMSGQUEUESoft": "819200",
                "LimitNICE": "0",
                "LimitNICESoft": "0",
                "LimitNOFILE": "524288",
                "LimitNOFILESoft": "1024",
                "LimitNPROC": "7606",
                "LimitNPROCSoft": "7606",
                "LimitRSS": "infinity",
                "LimitRSSSoft": "infinity",
                "LimitRTPRIO": "0",
                "LimitRTPRIOSoft": "0",
                "LimitRTTIME": "infinity",
                "LimitRTTIMESoft": "infinity",
                "LimitSIGPENDING": "7606",
                "LimitSIGPENDINGSoft": "7606",
                "LimitSTACK": "infinity",
                "LimitSTACKSoft": "8388608",
                "LoadState": "loaded",
                "LockPersonality": "no",
                "LogLevelMax": "-1",
                "LogRateLimitBurst": "0",
                "LogRateLimitIntervalUSec": "0",
                "LogsDirectoryMode": "0755",
                "MainPID": "168715",
                "MemoryAccounting": "yes",
                "MemoryCurrent": "3080192",
                "MemoryDenyWriteExecute": "no",
                "MemoryHigh": "infinity",
                "MemoryLimit": "infinity",
                "MemoryLow": "0",
                "MemoryMax": "infinity",
                "MemoryMin": "0",
                "MemorySwapMax": "infinity",
                "MountAPIVFS": "no",
                "MountFlags": "",
                "NFileDescriptorStore": "0",
                "NRestarts": "0",
                "NUMAMask": "",
                "NUMAPolicy": "n/a",
                "Names": "nginx.service",
                "NeedDaemonReload": "no",
                "Nice": "0",
                "NoNewPrivileges": "no",
                "NonBlocking": "no",
                "NotifyAccess": "none",
                "OOMPolicy": "stop",
                "OOMScoreAdjust": "0",
                "OnFailureJobMode": "replace",
                "PIDFile": "/run/nginx.pid",
                "Perpetual": "no",
                "PrivateDevices": "no",
                "PrivateMounts": "no",
                "PrivateNetwork": "no",
                "PrivateTmp": "no",
                "PrivateUsers": "no",
                "ProtectControlGroups": "no",
                "ProtectHome": "no",
                "ProtectHostname": "no",
                "ProtectKernelLogs": "no",
                "ProtectKernelModules": "no",
                "ProtectKernelTunables": "no",
                "ProtectSystem": "no",
                "RefuseManualStart": "no",
                "RefuseManualStop": "no",
                "ReloadResult": "success",
                "RemainAfterExit": "no",
                "RemoveIPC": "no",
                "Requires": "system.slice sysinit.target",
                "Restart": "no",
                "RestartKillSignal": "15",
                "RestartUSec": "100ms",
                "RestrictNamespaces": "no",
                "RestrictRealtime": "no",
                "RestrictSUIDSGID": "no",
                "Result": "success",
                "RootDirectoryStartOnly": "no",
                "RuntimeDirectoryMode": "0755",
                "RuntimeDirectoryPreserve": "no",
                "RuntimeMaxUSec": "infinity",
                "SameProcessGroup": "no",
                "SecureBits": "0",
                "SendSIGHUP": "no",
                "SendSIGKILL": "yes",
                "Slice": "system.slice",
                "StandardError": "inherit",
                "StandardInput": "null",
                "StandardInputData": "",
                "StandardOutput": "journal",
                "StartLimitAction": "none",
                "StartLimitBurst": "5",
                "StartLimitIntervalUSec": "10s",
                "StartupBlockIOWeight": "[not set]",
                "StartupCPUShares": "[not set]",
                "StartupCPUWeight": "[not set]",
                "StartupIOWeight": "[not set]",
                "StateChangeTimestamp": "Mon 2022-10-03 13:38:38 UTC",
                "StateChangeTimestampMonotonic": "1653327603774",
                "StateDirectoryMode": "0755",
                "StatusErrno": "0",
                "StopWhenUnneeded": "no",
                "SubState": "running",
                "SuccessAction": "none",
                "SyslogFacility": "3",
                "SyslogLevel": "6",
                "SyslogLevelPrefix": "yes",
                "SyslogPriority": "30",
                "SystemCallErrorNumber": "0",
                "TTYReset": "no",
                "TTYVHangup": "no",
                "TTYVTDisallocate": "no",
                "TasksAccounting": "yes",
                "TasksCurrent": "2",
                "TasksMax": "2281",
                "TimeoutAbortUSec": "5s",
                "TimeoutCleanUSec": "infinity",
                "TimeoutStartUSec": "1min 30s",
                "TimeoutStopUSec": "5s",
                "TimerSlackNSec": "50000",
                "Transient": "no",
                "Type": "forking",
                "UID": "[not set]",
                "UMask": "0022",
                "UnitFilePreset": "enabled",
                "UnitFileState": "enabled",
                "UtmpMode": "init",
                "WantedBy": "multi-user.target",
                "WatchdogSignal": "6",
                "WatchdogTimestampMonotonic": "0",
                "WatchdogUSec": "0"
        }
}
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


****************************************************************

TASK [Gathering Facts]


***************************************************************
ok: [client1]

TASK [apache : install apache]


*******************************************************
ok: [client1]

TASK [apache : copy index]


***********************************************************
ok: [client1]

PLAY RECAP
***************************************************************************
client1                                        : ok=3      changed=0       
unreachable=0        failed=0        skipped                    =0        rescued=0 
ignored=0

ansadmin@svl200:~/projet1$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── apache
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet1$ sudo vim hosts.yml
ansadmin@svl200:~/projet1$ curl client1
curl: (7) Failed to connect to client1 port 80: Connection refused
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ cd roles/
ansadmin@svl200:~/projet1/roles$ ls
apache
ansadmin@svl200:~/projet1/roles$ cp -r apache users
ansadmin@svl200:~/projet1/roles$
ansadmin@svl200:~/projet1/roles$ ls
apache    users
ansadmin@svl200:~/projet1/roles$ cd users
ansadmin@svl200:~/projet1/roles/users$ ls -lrt
total 16
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 templates
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 tasks
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 handlers
ansadmin@svl200:~/projet1/roles/users$ tree
.
├── handlers
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
│   └── index.html.j2
└── vars
        └── main.yml

4 directories, 4 files
ansadmin@svl200:~/projet1/roles/users$ cd ..
ansadmin@svl200:~/projet1/roles$ tree
.
├── apache
│   ├── handlers
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   │   └── index.html.j2
│   └── vars
│            └── main.yml
└── users
        ├── handlers
        │   └── main.yml
        ├── tasks
        │   └── main.yml
        ├── templates
        │   └── index.html.j2
        └── vars
                └── main.yml

10 directories, 8 files
ansadmin@svl200:~/projet1/roles$
ansadmin@svl200:~/projet1/roles$ ll
total 16
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct    5 13:16 ./
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct    5 13:14 ../
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct    5 12:15 apache/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct    5 13:16 users/
ansadmin@svl200:~/projet1/roles$ cd users/
ansadmin@svl200:~/projet1/roles/users$ ls
handlers    tasks    templates    vars
ansadmin@svl200:~/projet1/roles/users$
ansadmin@svl200:~/projet1/roles/users$ ls -lrt
total 16
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 templates
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 tasks
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 13:16 handlers
ansadmin@svl200:~/projet1/roles/users$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/users$ sudo vim templates/index.html.j2
ansadmin@svl200:~/projet1/roles/users$ sudo vim tasks/main.yml
ansadmin@svl200:~/projet1/roles/users$ cd
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml          index.html              items_users.yaml    projet
template.yaml              var
copie.yaml      fact.yaml          index.html.j2        list.yaml                 
projet1        template1.yaml            var
debug.yaml      fact1.yaml        index.html1.j2      locale.yml               
rep.yaml      var_dic.yml                  whe
debug1.yaml    handler.yaml    ip.txt                      nginx.yaml               
seq.yaml      var_dic2.yml                whe
exo2.yaml        hello.yaml        item_users.yaml    play-vars.yaml        shell.yml
var_dic_multi3.yml
exo3.yaml        hello.yml          items.yaml              play-vars.yml         
snap              vars.yml
ansadmin@svl200:~$ sudo vim item_users.yaml
ansadmin@svl200:~$ cd projet1/roles/users/
ansadmin@svl200:~/projet1/roles/users$ sudo vim tasks/main.yml
ansadmin@svl200:~/projet1/roles/users$
ansadmin@svl200:~/projet1/roles/users$ tree
.
├── handlers
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
│   └── index.html.j2
└── vars
        └── main.yml

4 directories, 4 files
ansadmin@svl200:~/projet1/roles/users$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/users$ cd ..
ansadmin@svl200:~/projet1/roles$ cd ..
ansadmin@svl200:~/projet1$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   ├── apache
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   │   └── index.html.j2
│   │   └── vars
│   │            └── main.yml
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

13 directories, 11 files
ansadmin@svl200:~/projet1$ cd roles/
ansadmin@svl200:~/projet1/roles$ cd users/
ansadmin@svl200:~/projet1/roles/users$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/users$
ansadmin@svl200:~/projet1/roles/users$ cd
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml          index.html              items_users.yaml    projet
template.yaml              var
copie.yaml      fact.yaml          index.html.j2        list.yaml                 
projet1        template1.yaml            var
debug.yaml      fact1.yaml        index.html1.j2      locale.yml               
rep.yaml      var_dic.yml                  whe
debug1.yaml    handler.yaml    ip.txt                      nginx.yaml               
seq.yaml      var_dic2.yml                whe
exo2.yaml        hello.yaml        item_users.yaml    play-vars.yaml        shell.yml
var_dic_multi3.yml
exo3.yaml        hello.yml          items.yaml              play-vars.yml         
snap              vars.yml
ansadmin@svl200:~$ cd projet
ansadmin@svl200:~/projet$ ls
group_vars    host_vars    install.yaml    inventory.yaml    vars_install.yaml
ansadmin@svl200:~/projet$ sudo vim vars_install.yaml
ansadmin@svl200:~/projet$
ansadmin@svl200:~/projet$ cd
ansadmin@svl200:~$ cd projet1/
group_vars/ hosts_vars/ roles/
ansadmin@svl200:~$ cd projet1/roles/
apache/ users/
ansadmin@svl200:~$ cd projet1/roles/users/
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~$ cd projet1/roles/users/vars/
ansadmin@svl200:~/projet1/roles/users/vars$ sudo vim vars/main.yml
ansadmin@svl200:~/projet1/roles/users/vars$ sudo main.yml
sudo: main.yml: command not found
ansadmin@svl200:~/projet1/roles/users/vars$ sudo vim main.yml
ansadmin@svl200:~/projet1/roles/users/vars$ cd ..
ansadmin@svl200:~/projet1/roles/users$ ansible-playbook -i hosts.yml site.yml
ERROR! the playbook: site.yml could not be found
ansadmin@svl200:~/projet1/roles/users$ cd ..
ansadmin@svl200:~/projet1/roles$ cd ..
ansadmin@svl200:~/projet1$ ansible-playbook -i hosts.yml site.yml

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client1]

TASK [apache : install apache]


*****************************************************************
ok: [client1]

TASK [apache : copy index]


*********************************************************************
ok: [client1]

PLAY RECAP
*************************************************************************************
client1                                        : ok=3      changed=0       
unreachable=0        failed=0        skipped=0        rescred=0

ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ cd roles/
ansadmin@svl200:~/projet1/roles$ ansible-playbook -i hosts.yml site.yml
ERROR! the playbook: site.yml could not be found
ansadmin@svl200:~/projet1/roles$
ansadmin@svl200:~/projet1/roles$ ls
apache    users
ansadmin@svl200:~/projet1/roles$ mv users /home/ansadmin/
ansadmin@svl200:~/projet1/roles$ cd
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml          index.html              items_users.yaml    projet
template.yaml              var
copie.yaml      fact.yaml          index.html.j2        list.yaml                 
projet1        template1.yaml            var
debug.yaml      fact1.yaml        index.html1.j2      locale.yml               
rep.yaml      users                              var
debug1.yaml    handler.yaml    ip.txt                      nginx.yaml               
seq.yaml      var_dic.yml                  whe
exo2.yaml        hello.yaml        item_users.yaml    play-vars.yaml        shell.yml
var_dic2.yml                whe
exo3.yaml        hello.yml          items.yaml              play-vars.yml         
snap              var_dic_multi3.yml
ansadmin@svl200:~$ mv users projet2
ansadmin@svl200:~$
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ ls
handlers    tasks    templates    vars
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ tree
.
├── handlers
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
│   └── index.html.j2
└── vars
        └── main.yml

4 directories, 4 files
ansadmin@svl200:~/projet2$ mkdir roles
ansadmin@svl200:~/projet2$ cd ..
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml          index.html              items_users.yaml    projet
snap                                var
copie.yaml      fact.yaml          index.html.j2        list.yaml                 
projet1        template.yaml              var
debug.yaml      fact1.yaml        index.html1.j2      locale.yml               
projet2        template1.yaml            var
debug1.yaml    handler.yaml    ip.txt                      nginx.yaml               
rep.yaml      var_dic.yml                  whe
exo2.yaml        hello.yaml        item_users.yaml    play-vars.yaml        seq.yaml 
var_dic2.yml                whe
exo3.yaml        hello.yml          items.yaml              play-vars.yml         
shell.yml    var_dic_multi3.yml
ansadmin@svl200:~$ cd projet
projet/    projet1/ projet2/
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ ls
handlers    roles    tasks    templates    vars
ansadmin@svl200:~/projet2$ mv handlers tasks templates vars roles/
ansadmin@svl200:~/projet2$ ls
roles
ansadmin@svl200:~/projet2$ cd roles/
ansadmin@svl200:~/projet2/roles$ ls
handlers    tasks    templates    vars
ansadmin@svl200:~/projet2/roles$ mkdir user
ansadmin@svl200:~/projet2/roles$ ls
handlers    tasks    templates    user    vars
ansadmin@svl200:~/projet2/roles$ mv handlers tasks templates vars user/
ansadmin@svl200:~/projet2/roles$ cd user/
handlers/    tasks/          templates/ vars/
ansadmin@svl200:~/projet2/roles$ cd ..
ansadmin@svl200:~/projet2$ tree
.
└── roles
        └── user
                ├── handlers
                │   └── main.yml
                ├── tasks
                │   └── main.yml
                ├── templates
                │   └── index.html.j2
                └── vars
                        └── main.yml

6 directories, 4 files
ansadmin@svl200:~/projet2$ sudo vim roles/user/handlers/main.yml
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ cd projet1/
ansadmin@svl200:~/projet1$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/projet1$ cp group_vars hosts_vars hosts.yml site.yml ../projet
projet/    projet1/ projet2/
ansadmin@svl200:~/projet1$ cp group_vars hosts_vars hosts.yml site.yml ../projet2
cp: -r not specified; omitting directory 'group_vars'
cp: -r not specified; omitting directory 'hosts_vars'
ansadmin@svl200:~/projet1$ cp -r group_vars hosts_vars hosts.yml site.yml ../projet2
ansadmin@svl200:~/projet1$ cd ..
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── user
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! the role 'apache' was not found in
/home/ansadmin/projet2/roles:/home/ansadmin/.ansible/rre/ansible/roles:/etc/ansible/
roles:/home/ansadmin/projet2

The error appears to be in '/home/ansadmin/projet2/site.yml': line 6, column 10, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    roles:
              - apache
                  ^ here
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── user
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ sudo vim site.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: creation d'utilisateurs


        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: creation d'utilisateurs
        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ ls
cible1.txt      exo4.yaml          index.html              items_users.yaml    projet
snap                                var
copie.yaml      fact.yaml          index.html.j2        list.yaml                 
projet1        template.yaml              var
debug.yaml      fact1.yaml        index.html1.j2      locale.yml               
projet2        template1.yaml            var
debug1.yaml    handler.yaml    ip.txt                      nginx.yaml               
rep.yaml      var_dic.yml                  whe
exo2.yaml        hello.yaml        item_users.yaml    play-vars.yaml        seq.yaml 
var_dic2.yml                whe
exo3.yaml        hello.yml          items.yaml              play-vars.yml         
shell.yml    var_dic_multi3.yml
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: creation d'utilisateurs


        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── user
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml
8 directories, 7 files
ansadmin@svl200:~/projet2$ sudo vim roles/user/vars/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: creation d'utilisateurs


        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: creation d'utilisateurs


        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: creation d'utilisateurs


        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


3, column 9,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: creation d'utilisateurs
        user:
                ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from
/home/ansadmin/projet2/roles/user/tasks/main.yml, l
column 3, found a duplicate dict key (when). Using last defined value only.
[WARNING]: While constructing a mapping from
/home/ansadmin/projet2/roles/user/tasks/main.yml, l
column 4, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from
/home/ansadmin/projet2/roles/user/tasks/main.yml, l
column 4, found a duplicate dict key (state). Using last defined value only.
[WARNING]: While constructing a mapping from
/home/ansadmin/projet2/roles/user/tasks/main.yml, l
column 4, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from
/home/ansadmin/projet2/roles/user/tasks/main.yml, l
column 4, found a duplicate dict key (state). Using last defined value only.
ERROR! conflicting action statements: apt, yum

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


8, column 3,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: installation packages


    ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


9, column 7,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: installation packages


      apt:
            ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


9, column 7,
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:

- name: installation packages


      apt:
            ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


9, column 7,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: installation packages


      apt:
            ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── user
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ sudo vim site.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/user/tasks/main.yml': line


9, column 7,
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: installation packages


      apt:
            ^ here
ansadmin@svl200:~/projet2$ sudo vim hosts.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── user
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ cd roles
ansadmin@svl200:~/projet2/roles$ mv user/ users/
ansadmin@svl200:~/projet2/roles$
ansadmin@svl200:~/projet2/roles$ cd ..
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ sudo vim site.yml
ansadmin@svl200:~/projet2$ sudo vim roles/user/tasks/main.yml
ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/projet2$ sudo vim roles/users/templates/index.html.j2
ansadmin@svl200:~/projet2$ sudo vim hosts.yml
ansadmin@svl200:~/projet2$ sudo vim site.yml
ansadmin@svl200:~/projet2$ sudo vim roles/users/vars/main.yml
*ansadmin@svl200:~/projet2$ansible-playbook -i hosts.yml site.yml
usage: ansible-playbook [-h] [--version] [-v] [-k] [--private-key PRIVATE_KEY_FILE]
[-u REMOTE_U
                                                [-c CONNECTION] [-T TIMEOUT] [--ssh-
common-args SSH_COMMON_ARGS]
                                                [--sftp-extra-args SFTP_EXTRA_ARGS]
[--scp-extra-args SCP_EXTRA_ARGS]
                                                [--ssh-extra-args SSH_EXTRA_ARGS] [--
force-handlers] [--flush-cache] [-b
                                                [--become-method BECOME_METHOD] [--
become-user BECOME_USER] [-K] [-t TAG
                                                [--skip-tags SKIP_TAGS] [-C] [--
syntax-check] [-D] [-i INVENTORY] [--lis
                                                [-l SUBSET] [-e EXTRA_VARS] [--vault-
id VAULT_IDS]
                                                [--ask-vault-pass | --vault-password-
file VAULT_PASSWORD_FILES] [-f FORK
                                                [-M MODULE_PATH] [--list-tasks] [--
list-tags] [--step]
                                                [--start-at-task START_AT_TASK]
                                                playbook [playbook ...]
ansible-playbook: error: the following arguments are required: playbook
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.ymlsite.yml
usage: ansible-playbook [-h] [--version] [-v] [-k] [--private-key PRIVATE_KEY_FILE]
[-u REMOTE_U
                                                [-c CONNECTION] [-T TIMEOUT] [--ssh-
common-args SSH_COMMON_ARGS]
                                                [--sftp-extra-args SFTP_EXTRA_ARGS]
[--scp-extra-args SCP_EXTRA_ARGS]
                                                [--ssh-extra-args SSH_EXTRA_ARGS] [--
force-handlers] [--flush-cache] [-b
                                                [--become-method BECOME_METHOD] [--
become-user BECOME_USER] [-K] [-t TAG
                                                [--skip-tags SKIP_TAGS] [-C] [--
syntax-check] [-D] [-i INVENTORY] [--lis
                                                [-l SUBSET] [-e EXTRA_VARS] [--vault-
id VAULT_IDS]
                                                [--ask-vault-pass | --vault-password-
file VAULT_PASSWORD_FILES] [-f FORK
                                                [-M MODULE_PATH] [--list-tasks] [--
list-tags] [--step]
                                                [--start-at-task START_AT_TASK]
                                                playbook [playbook ...]
ansible-playbook: error: the following arguments are required: playbook
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/users/tasks/main.yml': line


9, column 7
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: installation packages


      apt:
            ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/projet2/roles/users/tasks/main.yml': line


9, column 7
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: installation packages


      apt:
            ^ here
ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
The authenticity of host '[client2]:55600 ([141.95.160.133]:55600)' can't be
established.
ECDSA key fingerprint is SHA256:XtY+kTiWN4Ohe3xBY3YAQ9YLSSuP7bbmxZjN/R9SBcs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
ok: [client2]

TASK [users : creation d'utilisateurs]


*********************************************************
changed: [client2] => (item=1)
changed: [client2] => (item=2)
changed: [client2] => (item=3)
changed: [client2] => (item=4)
changed: [client2] => (item=5)

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [client2] => (item=['tree', 'curl', 'zip'])
TASK [users : installation packages]
***********************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [client2]: FAILED! => {"msg": "The conditional check 'distribution
== \"Centos\"' failed.s: error while evaluating conditional (distribution
== \"Centos\"): 'distribution' is undefined\appears to be in
'/home/ansadmin/projet2/roles/users/tasks/main.yml': line 15, column 3, but maye in
the file depending on the exact syntax problem.\n\nThe offending line appears to be:\
n\n\n-lation packages\n    ^ here\n"}

PLAY RECAP
*************************************************************************************
client2                                        : ok=3      changed=2     
unreachable=0        failed=1      skipped=0        rescred=0

ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client2]

TASK [users : creation d'utilisateurs]


*********************************************************
ok: [client2] => (item=1)
ok: [client2] => (item=2)
ok: [client2] => (item=3)
ok: [client2] => (item=4)
ok: [client2] => (item=5)

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [client2] => (item=['tree', 'curl', 'zip'])

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [client2]: FAILED! => {"msg": "The conditional check 'distribution
== \"Centos\"' failed.s: error while evaluating conditional (distribution
== \"Centos\"): 'distribution' is undefined\appears to be in
'/home/ansadmin/projet2/roles/users/tasks/main.yml': line 15, column 3, but maye in
the file depending on the exact syntax problem.\n\nThe offending line appears to be:\
n\n\n-lation packages\n    ^ here\n"}

PLAY RECAP
*************************************************************************************
client2                                        : ok=3      changed=0       
unreachable=0        failed=1      skipped=0        rescred=0

ansadmin@svl200:~/projet2$ sudo vim roles/users/vars/main.yml


ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ sudo vim roles/users/templates/index.html.j2
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client2]

TASK [users : creation d'utilisateurs]


*********************************************************
ok: [client2] => (item=1)
ok: [client2] => (item=2)
ok: [client2] => (item=3)
ok: [client2] => (item=4)
ok: [client2] => (item=5)

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [client2] => (item=['tree', 'curl', 'zip'])

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [client2]: FAILED! => {"msg": "The conditional check 'distribution
== \"Centos\"' failed.s: error while evaluating conditional (distribution
== \"Centos\"): 'distribution' is undefined\appears to be in
'/home/ansadmin/projet2/roles/users/tasks/main.yml': line 15, column 3, but maye in
the file depending on the exact syntax problem.\n\nThe offending line appears to be:\
n\n\n-lation packages\n    ^ here\n"}

PLAY RECAP
*************************************************************************************
client2                                        : ok=3      changed=0       
unreachable=0        failed=1      skipped=0        rescred=0

ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml


ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client2]

TASK [users : creation d'utilisateurs]


*********************************************************
ok: [client2] => (item=1)
ok: [client2] => (item=2)
ok: [client2] => (item=3)
ok: [client2] => (item=4)
ok: [client2] => (item=5)

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [client2] => (item=['tree', 'curl', 'zip'])

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [client2]: FAILED! => {"msg": "The conditional check 'distribution
== \"Ubuntu\"' failed.s: error while evaluating conditional (distribution
== \"Ubuntu\"): 'distribution' is undefined\appears to be in
'/home/ansadmin/projet2/roles/users/tasks/main.yml': line 15, column 3, but maye in
the file depending on the exact syntax problem.\n\nThe offending line appears to be:\
n\n\n-lation packages\n    ^ here\n"}

PLAY RECAP
*************************************************************************************
client2                                        : ok=3      changed=0       
unreachable=0        failed=1      skipped=0        rescred=0

ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml


ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client2]

TASK [users : creation d'utilisateurs]


*********************************************************
ok: [client2] => (item=1)
ok: [client2] => (item=2)
ok: [client2] => (item=3)
ok: [client2] => (item=4)
ok: [client2] => (item=5)

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [client2] => (item=['tree', 'curl', 'zip'])

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [client2]: FAILED! => {"msg": "The conditional check 'dnsible_distribution
== \"Centos\"'error was: error while evaluating conditional (dnsible_distribution
== \"Centos\"): 'dnsible_dis undefined\n\nThe error appears to be in
'/home/ansadmin/projet2/roles/users/tasks/main.yml': li 3, but may\nbe elsewhere in
the file depending on the exact syntax problem.\n\nThe offending li be:\n\n\n- name:
installation packages\n    ^ here\n"}

PLAY RECAP
*************************************************************************************
client2                                        : ok=3      changed=0       
unreachable=0        failed=1      skipped=0        rescred=0

ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/projet2$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet2/hosts.yml, line
3, column 7,
duplicate dict key (cible1). Using last defined value only.

PLAY [install apache]


**************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [client2]

TASK [users : creation d'utilisateurs]


*********************************************************
ok: [client2] => (item=1)
ok: [client2] => (item=2)
ok: [client2] => (item=3)
ok: [client2] => (item=4)
ok: [client2] => (item=5)

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [client2] => (item=['tree', 'curl', 'zip'])

TASK [users : installation packages]


***********************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions
is depreca
of using a loop to supply multiple items and specifying `name: "{{item}}"`, please
use `name:
'{{packages}}'` and remove the loop. This feature will be removed in version 2.11.
Deprecation w
be disabled by setting deprecation_warnings=False in ansible.cfg.
skipping: [client2] => (item=[])

TASK [users : copy index]


**********************************************************************
changed: [client2]

RUNNING HANDLER [users : restart_apache]


*******************************************************
changed: [client2]

PLAY RECAP
*************************************************************************************
client2                                        : ok=5      changed=2     
unreachable=0        failed=0        skipped=1      rescred=0

ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ ansible-galaxy init projet
projet/    projet1/ projet2/
ansadmin@svl200:~$ ansible-galaxy init projet3
- Role projet3 was created successfully
ansadmin@svl200:~$ cd projet3
ansadmin@svl200:~/projet3$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

8 directories, 8 files
ansadmin@svl200:~/projet3$
ansadmin@svl200:~/projet3$ cd
ansadmin@svl200:~$ ansible-galaxy install projet3 geerlingguy.apache
- downloading role 'projet3', owned by
[WARNING]: - projet3 was NOT installed successfully: None (HTTP Code: 400, Message:
Bad Request)
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the
list.
ansadmin@svl200:~$ ansible-galaxy install geerlingguy.apache
- downloading role 'apache', owned by geerlingguy
- downloading role from
https://github.com/geerlingguy/ansible-role-apache/archive/3.3.0.tar.gz
- extracting geerlingguy.apache to /home/ansadmin/.ansible/roles/geerlingguy.apache
- geerlingguy.apache (3.3.0) was installed successfully
ansadmin@svl200:~$ mkdir projet4
ansadmin@svl200:~$ ansible-galaxy install geerlingguy.apache -p projet4
- downloading role 'apache', owned by geerlingguy
- downloading role from
https://github.com/geerlingguy/ansible-role-apache/archive/3.3.0.tar.gz
- extracting geerlingguy.apache to /home/ansadmin/projet4/geerlingguy.apache
- geerlingguy.apache (3.3.0) was installed successfully
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ tree
.
└── geerlingguy.apache
        ├── LICENSE
        ├── README.md
        ├── defaults
        │   └── main.yml
        ├── handlers
        │   └── main.yml
        ├── meta
        │   └── main.yml
        ├── molecule
        │   └── default
        │            ├── converge.yml
        │            └── molecule.yml
        ├── tasks
        │   ├── configure-Debian.yml
        │   ├── configure-RedHat.yml
        │   ├── configure-Solaris.yml
        │   ├── configure-Suse.yml
        │   ├── main.yml
        │   ├── setup-Debian.yml
        │   ├── setup-RedHat.yml
        │   ├── setup-Solaris.yml
        │   └── setup-Suse.yml
        ├── templates
        │   └── vhosts.conf.j2
        └── vars
                ├── AmazonLinux.yml
                ├── Debian.yml
                ├── RedHat.yml
                ├── Solaris.yml
                ├── Suse.yml
                ├── apache-22.yml
                └── apache-24.yml

9 directories, 24 files
ansadmin@svl200:~/projet4$
ansadmin@svl200:~/projet4$ cd geerlingguy.apache/
.github/      defaults/    handlers/    meta/            molecule/    tasks/         
templates/ vars/
ansadmin@svl200:~/projet4$ cd geerlingguy.apache
ansadmin@svl200:~/projet4/geerlingguy.apache$ ls -lrt
total 44
-rw-rw-r-- 1 ansadmin ansadmin 8359 May 23 05:41 README.md
-rw-rw-r-- 1 ansadmin ansadmin 1080 May 23 05:41 LICENSE
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct    5 14:52 molecule
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 14:52 handlers
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 14:52 defaults
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 14:52 vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 14:52 templates
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 14:52 tasks
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct    5 14:52 meta
ansadmin@svl200:~/projet4/geerlingguy.apache$ cd tasks/
ansadmin@svl200:~/projet4/geerlingguy.apache/tasks$ ls
configure-Debian.yml    configure-Solaris.yml    main.yml                    setup-
RedHat.yml      setup-Suse.yml
configure-RedHat.yml    configure-Suse.yml          setup-Debian.yml    setup-
Solaris.yml
ansadmin@svl200:~/projet4/geerlingguy.apache/tasks$ sudo vim main.yml
ansadmin@svl200:~/projet4/geerlingguy.apache/tasks$ sudo vim main.yml
ansadmin@svl200:~/projet4/geerlingguy.apache/tasks$ cd ..
ansadmin@svl200:~/projet4/geerlingguy.apache$ cd ..
ansadmin@svl200:~/projet4$ tree
.
└── geerlingguy.apache
        ├── LICENSE
        ├── README.md
        ├── defaults
        │   └── main.yml
        ├── handlers
        │   └── main.yml
        ├── meta
        │   └── main.yml
        ├── molecule
        │   └── default
        │            ├── converge.yml
        │            └── molecule.yml
        ├── tasks
        │   ├── configure-Debian.yml
        │   ├── configure-RedHat.yml
        │   ├── configure-Solaris.yml
        │   ├── configure-Suse.yml
        │   ├── main.yml
        │   ├── setup-Debian.yml
        │   ├── setup-RedHat.yml
        │   ├── setup-Solaris.yml
        │   └── setup-Suse.yml
        ├── templates
        │   └── vhosts.conf.j2
        └── vars
                ├── AmazonLinux.yml
                ├── Debian.yml
                ├── RedHat.yml
                ├── Solaris.yml
                ├── Suse.yml
                ├── apache-22.yml
                └── apache-24.yml

9 directories, 24 files
ansadmin@svl200:~/projet4$ cd
ansadmin@svl200:~$ tree
.
├── cible1.txt
├── copie.yaml
├── debug.yaml
├── debug1.yaml
├── exo2.yaml
├── exo3.yaml
├── exo4.yaml
├── fact.yaml
├── fact1.yaml
├── handler.yaml
├── hello.yaml
├── hello.yml
├── index.html
├── index.html.j2
├── index.html1.j2
├── ip.txt
├── item_users.yaml
├── items.yaml
├── items_users.yaml
├── list.yaml
├── locale.yml
├── nginx.yaml
├── play-vars.yaml
├── play-vars.yml
├── projet
│   ├── group_vars
│   │   ├── cible1.yaml
│   │   └── cible2.yaml
│   ├── host_vars
│   │   ├── client1.yaml
│   │   └── client2.yaml
│   ├── install.yaml
│   ├── inventory.yaml
│   └── vars_install.yaml
├── projet1
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── apache
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── projet2
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── users
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── projet3
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── projet4
│   └── geerlingguy.apache
│            ├── LICENSE
│            ├── README.md
│            ├── defaults
│            │   └── main.yml
│            ├── handlers
│            │   └── main.yml
│            ├── meta
│            │   └── main.yml
│            ├── molecule
│            │   └── default
│            │            ├── converge.yml
│            │            └── molecule.yml
│            ├── tasks
│            │   ├── configure-Debian.yml
│            │   ├── configure-RedHat.yml
│            │   ├── configure-Solaris.yml
│            │   ├── configure-Suse.yml
│            │   ├── main.yml
│            │   ├── setup-Debian.yml
│            │   ├── setup-RedHat.yml
│            │   ├── setup-Solaris.yml
│            │   └── setup-Suse.yml
│            ├── templates
│            │   └── vhosts.conf.j2
│            └── vars
│                    ├── AmazonLinux.yml
│                    ├── Debian.yml
│                    ├── RedHat.yml
│                    ├── Solaris.yml
│                    ├── Suse.yml
│                    ├── apache-22.yml
│                    └── apache-24.yml
├── rep.yaml
├── seq.yaml
├── shell.yml
├── snap
│   └── tree
│            ├── 18
│            ├── common
│            └── current -> 18
├── template.yaml
├── template1.yaml
├── var_dic.yml
├── var_dic2.yml
├── var_dic_multi3.yml
├── vars.yml
├── vars2.yml
├── vars_multi.yml
├── when.yaml
└── when1.yaml

45 directories, 90 files
ansadmin@svl200:~$ ansible-playbook -i projet4
usage: ansible-playbook [-h] [--version] [-v] [-k] [--private-key PRIVATE_KEY_FILE]
                                                [-u REMOTE_USER] [-c CONNECTION] [-T
TIMEOUT]
                                                [--ssh-common-args SSH_COMMON_ARGS]
[--sftp-extra-args SFTP_EXTRA_ARGS]
                                                [--scp-extra-args SCP_EXTRA_ARGS] [--
ssh-extra-args SSH_EXTRA_ARGS]
                                                [--force-handlers] [--flush-cache] [-
b] [--become-method BECOME_METHOD]
                                                [--become-user BECOME_USER] [-K] [-t
TAGS] [--skip-tags SKIP_TAGS] [-C]
                                                [--syntax-check] [-D] [-i INVENTORY]
[--list-hosts] [-l SUBSET]
                                                [-e EXTRA_VARS] [--vault-id
VAULT_IDS]
                                                [--ask-vault-pass | --vault-password-
file VAULT_PASSWORD_FILES] [-f FORK
                                                [-M MODULE_PATH] [--list-tasks] [--
list-tags] [--step]
                                                [--start-at-task START_AT_TASK]
                                                playbook [playbook ...]
ansible-playbook: error: the following arguments are required: playbook
ansadmin@svl200:~$
ansadmin@svl200:~$ cd projet4/geerlingguy.apache/
ansadmin@svl200:~/projet4/geerlingguy.apache$ sudo vim site.yml
ansadmin@svl200:~/projet4/geerlingguy.apache$ cd
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/projet2$ cp hosts.yml ../projet
projet/    projet1/ projet2/ projet3/ projet4/
ansadmin@svl200:~/projet2$ cp hosts.yml ../projet4/
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ansible-playbook -i hosts.yml site.yml
ERROR! the playbook: site.yml could not be found
ansadmin@svl200:~/projet4$ tree
.
├── geerlingguy.apache
│   ├── LICENSE
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── molecule
│   │   └── default
│   │            ├── converge.yml
│   │            └── molecule.yml
│   ├── site.yml
│   ├── tasks
│   │   ├── configure-Debian.yml
│   │   ├── configure-RedHat.yml
│   │   ├── configure-Solaris.yml
│   │   ├── configure-Suse.yml
│   │   ├── main.yml
│   │   ├── setup-Debian.yml
│   │   ├── setup-RedHat.yml
│   │   ├── setup-Solaris.yml
│   │   └── setup-Suse.yml
│   ├── templates
│   │   └── vhosts.conf.j2
│   └── vars
│            ├── AmazonLinux.yml
│            ├── Debian.yml
│            ├── RedHat.yml
│            ├── Solaris.yml
│            ├── Suse.yml
│            ├── apache-22.yml
│            └── apache-24.yml
└── hosts.yml

9 directories, 26 files
ansadmin@svl200:~/projet4$ :q
:q: command not found
ansadmin@svl200:~/projet4$
ansadmin@svl200:~/projet4$ cd
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ cp site.yml ../projet4/
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet4/hosts.yml,
line 3, column 7, found a duplicate dict key (cible1). Using last defined value
only.
ERROR! the role 'users' was not found in /home/ansadmin/projet4/roles:/home/ansa     
dmin/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/ansadmin/p     
rojet4

The error appears to be in '/home/ansadmin/projet4/site.yml': line 6, column 9,      


but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    roles:
            - users
                ^ here
ansadmin@svl200:~/projet4$ tree
.
├── geerlingguy.apache
│   ├── LICENSE
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── molecule
│   │   └── default
│   │            ├── converge.yml
│   │            └── molecule.yml
│   ├── site.yml
│   ├── tasks
│   │   ├── configure-Debian.yml
│   │   ├── configure-RedHat.yml
│   │   ├── configure-Solaris.yml
│   │   ├── configure-Suse.yml
│   │   ├── main.yml
│   │   ├── setup-Debian.yml
│   │   ├── setup-RedHat.yml
│   │   ├── setup-Solaris.yml
│   │   └── setup-Suse.yml
│   ├── templates
│   │   └── vhosts.conf.j2
│   └── vars
│            ├── AmazonLinux.yml
│            ├── Debian.yml
│            ├── RedHat.yml
│            ├── Solaris.yml
│            ├── Suse.yml
│            ├── apache-22.yml
│            └── apache-24.yml
├── hosts.yml
└── site.yml

9 directories, 27 files
ansadmin@svl200:~/projet4$ sudo vim site.yml
ansadmin@svl200:~/projet4$ geerlingguy.apache^C
ansadmin@svl200:~/projet4$ sudo vim site.yml
ansadmin@svl200:~/projet4$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet4/hosts.yml,
line 3, column 7, found a duplicate dict key (cible1). Using last defined value
only.

PLAY [install apache] **********************************************************

TASK [Gathering Facts] *********************************************************


fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect t     
o the host via ssh: ssh: connect to host client2 port 22: Connection refused", "     
unreachable": true}

PLAY RECAP *********************************************************************


client2                                        : ok=0        changed=0       
unreachable=1      failed=0        s                                kipped=0       
rescued=0        ignored=0

ansadmin@svl200:~/projet4$ tree
.
├── geerlingguy.apache
│   ├── LICENSE
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── molecule
│   │   └── default
│   │            ├── converge.yml
│   │            └── molecule.yml
│   ├── site.yml
│   ├── tasks
│   │   ├── configure-Debian.yml
│   │   ├── configure-RedHat.yml
│   │   ├── configure-Solaris.yml
│   │   ├── configure-Suse.yml
│   │   ├── main.yml
│   │   ├── setup-Debian.yml
│   │   ├── setup-RedHat.yml
│   │   ├── setup-Solaris.yml
│   │   └── setup-Suse.yml
│   ├── templates
│   │   └── vhosts.conf.j2
│   └── vars
│            ├── AmazonLinux.yml
│            ├── Debian.yml
│            ├── RedHat.yml
│            ├── Solaris.yml
│            ├── Suse.yml
│            ├── apache-22.yml
│            └── apache-24.yml
├── hosts.yml
└── site.yml

9 directories, 27 files
ansadmin@svl200:~/projet4$ sudo vim site.yml
ansadmin@svl200:~/projet4$ sudo vim hosts.yml
ansadmin@svl200:~/projet4$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet4/hosts.yml,
line 3, column 7, found a duplicate dict key (cible1). Using last defined value
only.

PLAY [install apache] **********************************************************

TASK [Gathering Facts] *********************************************************


fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect t     
o the host via ssh: ssh: connect to host client2 port 22: Connection refused", "     
unreachable": true}

PLAY RECAP *********************************************************************


client2                                        : ok=0        changed=0       
unreachable=1      failed=0        s                                kipped=0       
rescued=0        ignored=0

ansadmin@svl200:~/projet4$ cd
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/projet2$ cp -r group_vars hosts_vars ../projet4/
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/projet4/hosts.yml,
line 3, column 7, found a duplicate dict key (cible1). Using last defined value
only.

PLAY [install apache] **********************************************************

TASK [Gathering Facts] *********************************************************


ok: [client2]

TASK [geerlingguy.apache : Include OS-specific variables.] *********************


ok: [client2]

TASK [geerlingguy.apache : Include variables for Amazon Linux.] ****************


skipping: [client2]

TASK [geerlingguy.apache : Define apache_packages.] ****************************


ok: [client2]

TASK [geerlingguy.apache : include_tasks] **************************************


included: /home/ansadmin/.ansible/roles/geerlingguy.apache/tasks/setup-Debian.ym     
l for client2

TASK [geerlingguy.apache : Update apt cache.] **********************************


changed: [client2]

TASK [geerlingguy.apache : Ensure Apache is installed on Debian.] **************


ok: [client2]

TASK [geerlingguy.apache : Get installed version of Apache.] *******************


ok: [client2]

TASK [geerlingguy.apache : Create apache_version variable.] ********************


ok: [client2]

TASK [geerlingguy.apache : Include Apache 2.2 variables.] **********************


skipping: [client2]

TASK [geerlingguy.apache : Include Apache 2.4 variables.] **********************


ok: [client2]

TASK [geerlingguy.apache : Configure Apache.] **********************************


included: /home/ansadmin/.ansible/roles/geerlingguy.apache/tasks/configure-Debia     
n.yml for client2

TASK [geerlingguy.apache : Configure Apache.] **********************************


ok: [client2] => (item={'regexp': '^Listen ', 'line': 'Listen 80'})

TASK [geerlingguy.apache : Enable Apache mods.] ********************************


changed: [client2] => (item=rewrite)
changed: [client2] => (item=ssl)

TASK [geerlingguy.apache : Disable Apache mods.] *******************************

TASK [geerlingguy.apache : Check whether certificates defined in vhosts exist.]     


***

TASK [geerlingguy.apache : Add apache vhosts configuration.] *******************


changed: [client2]

TASK [geerlingguy.apache : Add vhost symlink in sites-enabled.] ****************


changed: [client2]

TASK [geerlingguy.apache : Remove default vhost in sites-enabled.] *************


skipping: [client2]

TASK [geerlingguy.apache : Ensure Apache has selected state and enabled on boot.     
] ***
ok: [client2]

RUNNING HANDLER [geerlingguy.apache : restart apache] **************************


changed: [client2]

PLAY RECAP *********************************************************************


client2                                        : ok=16    changed=5     
unreachable=0        failed=0        s                                kipped=5     
rescued=0        ignored=0

ansadmin@svl200:~/projet4$ tree
.
├── geerlingguy.apache
│   ├── LICENSE
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── molecule
│   │   └── default
│   │            ├── converge.yml
│   │            └── molecule.yml
│   ├── site.yml
│   ├── tasks
│   │   ├── configure-Debian.yml
│   │   ├── configure-RedHat.yml
│   │   ├── configure-Solaris.yml
│   │   ├── configure-Suse.yml
│   │   ├── main.yml
│   │   ├── setup-Debian.yml
│   │   ├── setup-RedHat.yml
│   │   ├── setup-Solaris.yml
│   │   └── setup-Suse.yml
│   ├── templates
│   │   └── vhosts.conf.j2
│   └── vars
│            ├── AmazonLinux.yml
│            ├── Debian.yml
│            ├── RedHat.yml
│            ├── Solaris.yml
│            ├── Suse.yml
│            ├── apache-22.yml
│            └── apache-24.yml
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
└── site.yml

11 directories, 28 files
ansadmin@svl200:~/projet4$
Network error: Software caused connection abort

────────────────────────────────────────────────────────────────────────────────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage
System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

10 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

*** System restart required ***


Last login: Wed Oct    5 07:39:52 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ tree
.
├── cible1.txt
├── copie.yaml
├── debug.yaml
├── debug1.yaml
├── exo2.yaml
├── exo3.yaml
├── exo4.yaml
├── fact.yaml
├── fact1.yaml
├── handler.yaml
├── hello.yaml
├── hello.yml
├── index.html
├── index.html.j2
├── index.html1.j2
├── ip.txt
├── item_users.yaml
├── items.yaml
├── items_users.yaml
├── list.yaml
├── locale.yml
├── nginx.yaml
├── play-vars.yaml
├── play-vars.yml
├── projet
│   ├── group_vars
│   │   ├── cible1.yaml
│   │   └── cible2.yaml
│   ├── host_vars
│   │   ├── client1.yaml
│   │   └── client2.yaml
│   ├── install.yaml
│   ├── inventory.yaml
│   └── vars_install.yaml
├── projet1
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── apache
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── projet2
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── users
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── projet3
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── projet4
│   ├── geerlingguy.apache
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── defaults
│   │   │   └── main.yml
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── meta
│   │   │   └── main.yml
│   │   ├── molecule
│   │   │   └── default
│   │   │            ├── converge.yml
│   │   │            └── molecule.yml
│   │   ├── site.yml
│   │   ├── tasks
│   │   │   ├── configure-Debian.yml
│   │   │   ├── configure-RedHat.yml
│   │   │   ├── configure-Solaris.yml
│   │   │   ├── configure-Suse.yml
│   │   │   ├── main.yml
│   │   │   ├── setup-Debian.yml
│   │   │   ├── setup-RedHat.yml
│   │   │   ├── setup-Solaris.yml
│   │   │   └── setup-Suse.yml
│   │   ├── templates
│   │   │   └── vhosts.conf.j2
│   │   └── vars
│   │            ├── AmazonLinux.yml
│   │            ├── Debian.yml
│   │            ├── RedHat.yml
│   │            ├── Solaris.yml
│   │            ├── Suse.yml
│   │            ├── apache-22.yml
│   │            └── apache-24.yml
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   └── site.yml
├── rep.yaml
├── seq.yaml
├── shell.yml
├── snap
│   └── tree
│            ├── 18
│            ├── common
│            └── current -> 18
├── template.yaml
├── template1.yaml
├── var_dic.yml
├── var_dic2.yml
├── var_dic_multi3.yml
├── vars.yml
├── vars2.yml
├── vars_multi.yml
├── when.yaml
└── when1.yaml

47 directories, 94 files
ansadmin@svl200:~$
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/projet2$ sudo vim site.yml
ansadmin@svl200:~/projet2$ sudo vim roles/users/handlers/main.yml
ansadmin@svl200:~/projet2$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/projet2$ sudo vim roles/users/templates/index.html.j2
ansadmin@svl200:~/projet2$ sudo vim roles/users/vars/main.yml
ansadmin@svl200:~/projet2$ sudo vim site.yml
ansadmin@svl200:~/projet2$ sudo vim group_vars/all.yml
ansadmin@svl200:~/projet2$ sudo vim hosts.yml
ansadmin@svl200:~/projet2$
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim /etc/
Display all 201 possibilities? (y or n)
ansadmin@svl200:~$ sudo vim /etc/hosts
ansadmin@svl200:~$ sudo vim /etc/ansible/hosts
ansadmin@svl200:~$
ansadmin@svl200:~$ ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
                      [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
                      [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
                      [-i identity_file] [-J [user@]host[:port]] [-L address]
                      [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p
port]
                      [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
                      [-w local_tun[:remote_tun]] destination [command]
ansadmin@svl200:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ansadmin/.ssh/id_rsa):
/home/ansadmin/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ansadmin/.ssh/id_rsa
Your public key has been saved in /home/ansadmin/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:JxwGhnJZfswUvx6gm7/XCGMXNUhKu+p80/p8jjTxJWw ansadmin@svl200
The key's randomart image is:
+---[RSA 3072]----+
|          ++ +o..          |
|    . +o * +. o        |
|      o    . X .. .      |
|              = +.o          |
|            . S =.E .    |
|              +++.= o      |
|            +. =+o.        |
|          o .oo+oo        |
|            o.+*+o.        |
+----[SHA256]-----+
ansadmin@svl200:~$ ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
                      [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
                      [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
                      [-i identity_file] [-J [user@]host[:port]] [-L address]
                      [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p
port]
                      [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
                      [-w local_tun[:remote_tun]] destination [command]
ansadmin@svl200:~$ copy id
ansadmin@svl200:~$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub
ansadmin@141.95.160.128                  -p 55600
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/ansadmin/.ssh/id_rs                a.pub"
The authenticity of host '[141.95.160.128]:55600 ([141.95.160.128]:55600)' can't be
esta                blished.
ECDSA key fingerprint is SHA256:Asg9qJaW9YQpni0qR69B2dHbik3PNd4RsVKxzOkb1vo.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out
any                  that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted
now i                t is to install the new keys
ansadmin@141.95.160.128's password:
Permission denied, please try again.
ansadmin@141.95.160.128's password:
Permission denied, please try again.
ansadmin@141.95.160.128's password:
ansadmin@141.95.160.128: Permission denied (publickey,password).
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo mkdir TP3
ansadmin@svl200:~$ cd TP3/
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}
PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                 the host via ssh: ansadmin@146.59.158.16: Permission denied
(publickey,password).", "unr                eachable": true}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                 the host via ssh: ansadmin@146.59.158.16: Permission denied
(publickey,password).", "unr                eachable": true}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                 the host via ssh: ansadmin@146.59.158.16: Permission denied
(publickey,password).", "unr                eachable": true}
fatal: [141.95.160.133]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.133: Permission denied
(publickey,password).", "u                nreachable": true}
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}

PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
141.95.160.133                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                 the host via ssh: ansadmin@146.59.158.16: Permission denied
(publickey,password).", "unr                eachable": true}
fatal: [141.95.160.133]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.133: Permission denied
(publickey,password).", "u                nreachable": true}
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}

PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
141.95.160.133                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                 the host via ssh: ansadmin@146.59.158.16: Permission denied
(publickey,password).", "unr                eachable": true}
fatal: [141.95.160.133]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.133: Permission denied
(publickey,password).", "u                nreachable": true}
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}

PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
141.95.160.133                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub
ansadmin@141.95.160                .16 -p 55600
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/ansadmin/.ssh/id_rs                a.pub"
^C
ansadmin@svl200:~/TP3$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub
ansadmin@141.95.160                .133 -p 55600
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/ansadmin/.ssh/id_rs                a.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out
any                  that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted
now i                t is to install the new keys
ansadmin@141.95.160.133's password:

Number of key(s) added: 1

Now try logging into the machine, with:      "ssh -p '55600'


'ansadmin@141.95.160.133'"
and check to make sure that only the key(s) you wanted were added.

ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml                                   


PLAY [creation de partition]
***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                 the host via ssh: ansadmin@146.59.158.16: Permission denied
(publickey,password).", "unr                eachable": true}
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}
ok: [141.95.160.133]

TASK [partition]
***********************************************************************
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "missing required
argument                s: device"}

PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub


ansadmin@146.59.158                .16 -p 55600
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/ansadmin/.ssh/id_rs                a.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out
any                  that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted
now i                t is to install the new keys
ansadmin@146.59.158.16's password:

Number of key(s) added: 1

Now try logging into the machine, with:      "ssh -p '55600'


'ansadmin@146.59.158.16'"
and check to make sure that only the key(s) you wanted were added.

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml                                   
PLAY [creation de partition]
***********************************************************

TASK [Gathering Facts]


*****************************************************************
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "missing required
arguments                : device"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "missing required
argument                s: device"}

PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml                                   
PLAY [creation de partition]
***********************************************************
TASK [Gathering Facts]
*****************************************************************
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to                the host via ssh: ansadmin@141.95.160.128: Permission denied
(publickey,password).", "u                nreachable": true}
ok: [146.59.158.16]
ok: [141.95.160.133]

TASK [partition]
***********************************************************************
^Lfatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "missing required
argumen                ts: device"}
fatal: [141.95.160.133]: FAILED! => {"changed": false, "msg": "missing required
argument                s: device"}

PLAY RECAP
*****************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0                        rescued=0        ignored=0
141.95.160.133                          : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml                                           
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "missing required
arguments                : device"}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "state is present but
all o                f the following are missing: number"}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": [250.0, "M"], "msg":
"The a                rgument 'part_end' doesn't respect required format.The size
unit is case sensitive."}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": [250.0, "m"], "msg":
"The a                rgument 'part_end' doesn't respect required format.The size
unit is case sensitive."}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": [250.0, "mb"], "msg":
"The                 argument 'part_end' doesn't respect required format.The size
unit is case sensitive."}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Error: Could not stat
devi                ce /tp3_ansible/exo1 - No such file or directory.\n", "msg":
"Error while getting device                information with parted script:
'/usr/sbin/parted -s -m /tp3_ansible/exo1 -- unit 'KiB'                print'",
"out": "", "rc": 1}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]
TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": [250.0, "M"], "msg":
"The a                rgument 'part_end' doesn't respect required format.The size
unit is case sensitive."}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ ^C
ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
[WARNING]: The value [250.0, 'M'] (type list) in a string field was converted to
"[250.0, 'M']" (type string). If this does not look like what you expect, quote the
entire value to ensure it does not change.
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Error interpreting
parted                 size output: '[250.0, 'M']'"}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Error: Could not stat
devi                ce /tp3_ansible/exo1 - No such file or directory.\n", "msg":
"Error while getting device                information with parted script:
'/usr/sbin/parted -s -m /tp3_ansible/exo1 -- unit 'KiB'                print'",
"out": "", "rc": 1}
PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Error: Could not stat
devi                ce /tp3_ansible/exo1 - No such file or directory.\n", "msg":
"Error while getting device                information with parted script:
'/usr/sbin/parted -s -m /tp3_ansible/exo1 -- unit 'KiB'                print'",
"out": "", "rc": 1}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Error: Could not stat
devi                ce /dev/aaw - No such file or directory.\n", "msg": "Error while
getting device informat                ion with parted script: '/usr/sbin/parted -s -
m /dev/aaw -- unit 'KiB' print'", "out": "                ", "rc": 1}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ ^C
ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml
PLAY [creation de partition]
***********************************************************

TASK [Gathering Facts]


*****************************************************************
ok: [146.59.158.16]

TASK [partition]
***********************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Warning: Unable to open
/u                sr/sbin/parted read-write (Text file busy).    /usr/sbin/parted has
been opened read-only.                \nError: Can't write to /usr/sbin/parted,
because it is opened read-only.\n", "msg": "Er                ror while running
parted script: /usr/sbin/parted -s -m -a optimal /usr/sbin/parted -- u               
nit KiB mklabel msdos mkpart primary 0% 100%", "out": "", "rc": 1}

PLAY RECAP
*****************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0                        rescued=0        ignored=0

ansadmin@svl200:~/TP3$ ansible cible1 -bm shell -a "mkdir /tp3"


[WARNING]: Consider using the file module with state=directory rather than running
'mkdir'.    If you need to use command because file is insufficient you can add
'warn:
false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid
of this message.
146.59.158.16 | CHANGED | rc=0 >>

ansadmin@svl200:~/TP3$ tree
ansadmin@svl200:~/TP3$ ansible cible1 -bm shell -a "mkdir tp3"
[WARNING]: Consider using the file module with state=directory rather than running
'mkdir'.    If
false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid
of this me
146.59.158.16 | CHANGED | rc=0 >>

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ansible cible1 -bm shell -a "mkdir /tp3"
[WARNING]: Consider using the file module with state=directory rather than running
'mkdir'.    If
false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid
of this me
146.59.158.16 | FAILED | rc=1 >>
mkdir: cannot create directory ‘/tp3’: File existsnon-zero return code
ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


*******************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]
TASK [partition]
*******************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Error: Could not stat
device /dev/information with parted script: '/usr/sbin/parted -s -m /dev/aaw -- unit
'KiB' print'", "out": "

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TP3$ sudo vim exo1.yaml


ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml

PLAY [creation de partition]


*******************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [partition]
*******************************************************************************
[WARNING]: The value 250 (type int) in a string field was converted to '250' (type
string). If t
ensure it does not change.
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": [250.0, ""], "msg": "The
argument 'e."}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ sudo vim exo1.yaml
ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ls
exo1.yaml
ansadmin@svl200:~/TP3$ mkdir roles
mkdir: cannot create directory ‘roles’: Permission denied
ansadmin@svl200:~/TP3$ sudo mkdir roles
ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ ll
total 16
drwxr-xr-x    3 root          root          4096 Oct    6 09:27 ./
drwxr-xr-x 11 ansadmin ansadmin 4096 Oct    6 07:59 ../
-rw-r--r--    1 root          root            209 Oct    6 09:23 exo1.yaml
drwxr-xr-x    2 root          root          4096 Oct    6 09:27 roles/
ansadmin@svl200:~/TP3$ cd
ansadmin@svl200:~$
ansadmin@svl200:~$ cd projet2
ansadmin@svl200:~/projet2$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/projet2$ cd
ansadmin@svl200:~$ cp projet2 TPansible
cp: -r not specified; omitting directory 'projet2'
ansadmin@svl200:~$ cp -r projet2    TPansible
ansadmin@svl200:~$
ansadmin@svl200:~$ cd TP
TP3/              TPansible/
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/TPansible$ cd
ansadmin@svl200:~$ cd TP3
ansadmin@svl200:~/TP3$ ls -lrt
total 8
-rw-r--r-- 1 root root    209 Oct    6 09:23 exo1.yaml
drwxr-xr-x 2 root root 4096 Oct    6 09:27 roles
ansadmin@svl200:~/TP3$
ansadmin@svl200:~/TP3$ cd
ansadmin@svl200:~$ cd TP
TP3/              TPansible/
ansadmin@svl200:~$ cd TPan
-bash: cd: TPan: No such file or directory
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/TPansible$ sudo vim
group_vars/ hosts.yml      hosts_vars/ roles/            site.yml
ansadmin@svl200:~/TPansible$ sudo vim
group_vars/ hosts.yml      hosts_vars/ roles/            site.yml
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ sudo vim roles/users/templates/index.html.j2
ansadmin@svl200:~/TPansible$ sudo vim roles/users/vars/main.yml
ansadmin@svl200:~/TPansible$ sudo vim group_vars/all.yml
ansadmin@svl200:~/TPansible$ sudo vim site.yml
ansadmin@svl200:~/TPansible$ sudo vim group_vars/all.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/TPansible/hosts.yml, line
3, column
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: utilisation de LVM
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/TPansible/hosts.yml, line
3, column
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: utilisation de LVM
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/TPansible/hosts.yml, line
3, column
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: utilisation de LVM
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
[WARNING]: While constructing a mapping from /home/ansadmin/TPansible/hosts.yml, line
3, column
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
[WARNING]: While constructing a mapping from /home/ansadmin/TPansible/hosts.yml, line
3, column
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ cd ..
ansadmin@svl200:~$ tree
.
├── TP3 [error opening dir]
├── TPansible
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── users
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── cible1.txt
├── copie.yaml
├── debug.yaml
├── debug1.yaml
├── exo2.yaml
├── exo3.yaml
├── exo4.yaml
├── fact.yaml
├── fact1.yaml
├── handler.yaml
├── hello.yaml
├── hello.yml
├── index.html
├── index.html.j2
├── index.html1.j2
├── ip.txt
├── item_users.yaml
├── items.yaml
├── items_users.yaml
├── list.yaml
├── locale.yml
├── nginx.yaml
├── play-vars.yaml
├── play-vars.yml
├── projet
│   ├── group_vars
│   │   ├── cible1.yaml
│   │   └── cible2.yaml
│   ├── host_vars
│   │   ├── client1.yaml
│   │   └── client2.yaml
│   ├── install.yaml
│   ├── inventory.yaml
│   └── vars_install.yaml
├── projet1
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── apache
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── projet2
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   ├── roles
│   │   └── users
│   │            ├── handlers
│   │            │   └── main.yml
│   │            ├── tasks
│   │            │   └── main.yml
│   │            ├── templates
│   │            │   └── index.html.j2
│   │            └── vars
│   │                    └── main.yml
│   └── site.yml
├── projet3
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── projet4
│   ├── geerlingguy.apache
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── defaults
│   │   │   └── main.yml
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── meta
│   │   │   └── main.yml
│   │   ├── molecule
│   │   │   └── default
│   │   │            ├── converge.yml
│   │   │            └── molecule.yml
│   │   ├── site.yml
│   │   ├── tasks
│   │   │   ├── configure-Debian.yml
│   │   │   ├── configure-RedHat.yml
│   │   │   ├── configure-Solaris.yml
│   │   │   ├── configure-Suse.yml
│   │   │   ├── main.yml
│   │   │   ├── setup-Debian.yml
│   │   │   ├── setup-RedHat.yml
│   │   │   ├── setup-Solaris.yml
│   │   │   └── setup-Suse.yml
│   │   ├── templates
│   │   │   └── vhosts.conf.j2
│   │   └── vars
│   │            ├── AmazonLinux.yml
│   │            ├── Debian.yml
│   │            ├── RedHat.yml
│   │            ├── Solaris.yml
│   │            ├── Suse.yml
│   │            ├── apache-22.yml
│   │            └── apache-24.yml
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts.yml
│   ├── hosts_vars
│   └── site.yml
├── rep.yaml
├── seq.yaml
├── shell.yml
├── snap
│   └── tree
│            ├── 18
│            ├── common
│            └── current -> 18
├── template.yaml
├── template1.yaml
├── var_dic.yml
├── var_dic2.yml
├── var_dic_multi3.yml
├── vars.yml
├── vars2.yml
├── vars_multi.yml
├── when.yaml
└── when1.yaml

57 directories, 101 files


ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
ERROR! the playbook: site.yml could not be found
ansadmin@svl200:~$ cd
.ansible/    .ssh/            TP3/              TPansible/ projet/        projet1/   
projet2/      projet3/      projet4/
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad
characters
will change, but still be user configurable on deprecation. This feature will be
removed in vers
be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv
to see detai
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad
characters
will change, but still be user configurable on deprecation. This feature will be
removed in vers
be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv
to see detai
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ cd
ansadmin@svl200:~$
ansadmin@svl200:~$ cd
.ansible/    .ssh/            TP3/              TPansible/ projet/        projet1/   
projet2/      projet3/      projet4/
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 7 files
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad
characters
will change, but still be user configurable on deprecation. This feature will be
removed in vers
be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv
to see detai
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    roles    site.yml
ansadmin@svl200:~/TPansible$ cd roles/
ansadmin@svl200:~/TPansible/roles$ ls
users
ansadmin@svl200:~/TPansible/roles$ cd users/$
-bash: cd: users/$: No such file or directory
ansadmin@svl200:~/TPansible/roles$ cd users/
ansadmin@svl200:~/TPansible/roles/users$ ls
handlers    tasks    templates    vars
ansadmin@svl200:~/TPansible/roles/users$ cp tasks/main.yml ../../
ansadmin@svl200:~/TPansible/roles/users$ cd ../../
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    main.yml    roles    site.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -kk -u apx28
SSH password:

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via s (publickey,password).", "unreachable": true}
fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via s (publickey,password).", "unreachable": true}
fatal: [141.95.160.128]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hosmission denied (publickey,password).", "unreachable": true}

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=1 
failed=0        skipped=0        resc
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc
client2                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub
ansadmin@141.95.160.1
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/ansadmin/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out
any that are
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted
now it is to
ansadmin@141.95.160.128's password:
Permission denied, please try again.
ansadmin@141.95.160.128's password:

ansadmin@svl200:~/TPansible$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub


apx28@141.95.160.128
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
"/home/ansadmin/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out
any that are
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted
now it is to
apx28@141.95.160.128's password:

Number of key(s) added: 1

Now try logging into the machine, with:      "ssh -p '55600' 'apx28@141.95.160.128'"
and check to make sure that only the key(s) you wanted were added.
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml -kk -u apx28
SSH password:
ERROR! conflicting action statements: hosts, tasks

The error appears to be in '/home/ansadmin/TPansible/roles/users/tasks/main.yml':


line 2, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: partition lvm
    ^ here
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -kk -u apx28
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -kk -u apx28
SSH password:

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: FAILED! => {"msg": "to use the 'ssh' connection type with
passwords, you must
fatal: [client2]: FAILED! => {"msg": "to use the 'ssh' connection type with
passwords, you must
fatal: [141.95.160.128]: FAILED! => {"msg": "to use the 'ssh' connection type with
passwords, yo

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=0        changed=0        unreachable=0 
failed=1      skipped=0        resc
client1                                        : ok=0        changed=0       
unreachable=0        failed=1      skipped=0        resc
client2                                        : ok=0        changed=0       
unreachable=0        failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via s (publickey,password).", "unreachable": true}
fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via s (publickey,password).", "unreachable": true}
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
changed: [141.95.160.128]
TASK [creation de fichier]
*********************************************************************
changed: [141.95.160.128]

TASK [filesystem]
******************************************************************************
changed: [141.95.160.128]

TASK [montage]
*********************************************************************************
changed: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=4      unreachable=0   
failed=0        skipped=0        resc
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc
client2                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ ls
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [client1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via s (publickey,password).", "unreachable": true}
fatal: [client2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the
host via s (publickey,password).", "unreachable": true}
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
changed: [141.95.160.128]

TASK [filesystem]
******************************************************************************
ok: [141.95.160.128]

TASK [montage]
*********************************************************************************
ok: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=1      unreachable=0   
failed=0        skipped=0        resc
client1                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc
client2                                        : ok=0        changed=0       
unreachable=1      failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim hosts.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
ok: [141.95.160.128]

TASK [montage]
*********************************************************************************
ok: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=0        unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml


ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
ok: [141.95.160.128]

TASK [montage]
*********************************************************************************
ok: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=0        unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml


ansadmin@svl200:~/TPansible$ sudo vim roles/users/tasks/main.yml
ansadmin@svl200:~/TPansible$ cat roles/users/tasks/main.yml
---
- name: partition lvm
    hosts: 141.95.160.128
    become: true

    tasks:
        - name: partition1
            lvol:
                vg: datavg
                lv: ansible_lv1_aaw
                size: 250M
                force: yes

        - name: creation de fichier


            file:
                    path: /tp3_aaw
                    state: directory
                    mode: 755

        - name: filesystem
            filesystem:
                fstype: xfs
                dev: /dev/datavg/ansible_lv1_aaw

        - name: montage
            mount:
                  path: /tp3_aaw
                  src: /dev/datavg/ansible_lv1_aaw
                  fstype: xfs
                  state: mounted

        - name: partition1
            lvol:
                vg: datavg
                lv: ansible_lv2_aaw
                size: 250M
                force: yes

        - name: creation de fichier


            file:
                    path: /tp3_aaw
                    state: directory
                    mode: 755

        - name: filesystem
            filesystem:
                fstype: xfs
                dev: /dev/datavg/ansible_lv2_aaw

        - name: montage
            mount:
                  path: /tp3_aaw
                  src: /dev/datavg/ansible_lv2_aaw
                  fstype: xfs
                  state: mounted

ansadmin@svl200:~/TPansible$ ^C
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
ok: [141.95.160.128]

TASK [montage]
*********************************************************************************
ok: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=0        unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ cd
ansadmin@svl200:~$ ansible 141.95.160.128 -bm shell -a "df -h /dev/datavg"
141.95.160.128 | UNREACHABLE! => {
        "changed": false,
        "msg": "Failed to connect to the host via ssh: ansadmin@141.95.160.128:
Permission denied (p
        "unreachable": true
}
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ tree
.
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── main.yml
├── roles
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

8 directories, 8 files
ansadmin@svl200:~/TPansible$ cd
ansadmin@svl200:~$ ls
TP3                    exo2.yaml          hello.yaml            item_users.yaml     
play-vars.yaml    projet4                temp
TPansible        exo3.yaml          hello.yml              items.yaml               
play-vars.yml      rep.yaml              var_
cible1.txt      exo4.yaml          index.html            items_users.yaml    projet 
seq.yaml              var_
copie.yaml      fact.yaml          index.html.j2      list.yaml                 
projet1                  shell.yml            var_
debug.yaml      fact1.yaml        index.html1.j2    locale.yml                projet2
snap                      vars
debug1.yaml    handler.yaml    ip.txt                    nginx.yaml               
projet3                  template.yaml    vars
ansadmin@svl200:~$
                lv: ansible_lv1_aaw
                size: 250M
                force: yes

        - name: creation de fichier


            file:
                    path: /tp3_aaw
                    state: directory
                    mode: 755

        - name: filesystem
            filesystem:
                fstype: xfs
                dev: /dev/datavg/ansible_lv1_aaw

        - name: montage
            mount:
                  path: /tp3_aaw
                  src: /dev/datavg/ansible_lv1_aaw
                  fstype: xfs
                  state: mounted

:
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
───────────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation
10 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Thu Oct    6 07:17:29 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$ history
        1    ssh-keygen -t rsa
        2    ssh
        3    ssh-copy-id ansadmin@146.59.156.114ssh-copy-id ansadmin@146.59.156.114
        4    sudo vim /etc/ssh/sshd_config
        5    ls -l .ssh/
        6    ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub ansadmin@146.59.158.16 -p
55600
        7    ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub ansadmin@141.95.160.133 -p
55600
        8    sudo vim /etc/ansible/hosts
        9    ansible all -m ping
      10    sudo vim /etc/ansible/hosts
      11    ansible all -m ping
      12    ansible cible1 -m ping
      13    ansible cible2 -m ping
      14    ansible 146.59.158.16 -m ping
      15    ansible 141.95.160.133 -m ping
      16    sudo touch cible1.txt
      17    ansible cible1 -m copy -a "src=cible1.txt dest=/tmp"
      18    ansible cible1 -m ls -a "dest=/tmp"
      19    ansible cible1 -m shell -a "ls -lrt /tmp"
      20    ansible cible1 -m file -a "dest=/tmp/cible1.txt mode=777"
      21    ansible cible1 -m user -a "name=cible1 state=present"
      22    ansible cible1 -b -m user -a "name=cible1 state=present"
      23    ansible cible1 -m shell -a "cat /etc/passwd | grep cible1"
      24    ansible all -b -m apt -a "name=curl state=latest"
      25    ansible cible1 -m service -a "name=cron state=started"
      26    ansible cible1 -b -m service -a "name=cron state=started"
      27    ansible cible1 -b -m service -a "name=cron state=stopped"
      28    ansible cible1 -b -m systemd -a "name=cron state=started"
      29    ansible cible1 -b -m systemd -a "name=cron state=stopped"
      30    ansible cible1 -b -m systemd -a "name=cron state=restarted"
      31    ansible all -a 'whoami'
      32    ansible cible1 -a 'whoami'
      33    ansible cible2 -a 'whoami'
      34    ansible all -ab 'whoami'
      35    ansible all -b -a 'whoami'
      36    ansible all -ba 'whoami'
      37    sudo vim nginx.yaml
      38    ansible-playbook nginx.yml
      39    ansible-playbook nginx.yaml
      40    sudo vim nginx.yaml
      41    ansible all -m service -a "name=apache2 state=status"
      42    ansible cible1 -bm shell -a "systemctl status cron"
      43    uname -a
      44    uname -r
      45    cat /etc/os-release
      46    lsb_release
      47    ansible all -a "cat /ho
      48    sudo vim shell.yml
      49    ansible all -a "cat /home/ansadmin/resultat.txt"
      50    ansible-playbook resultat.txt
      51    sudo vim shell.yml
      52    ansible-playbook /home/ansadmin/resultat.txt
      53    sudo vim shell.yml
      54    ansible-playbook shell.yml
      55    ansible all -a "cat /home/ansadmin/resultat.txt"
      56    sudo vim shell.yml
      57    ansible-playbook shell.yml
      58    sudo vim shell.yml
      59    ansible-playbook shell.yml
      60    sudo vim shell.yml
      61    ansible-playbook shell.yml
      62    ansible-playbook -b shell.yml
      63    ansible all -a "cat /home/ansadmin/resultat.txt"
      64    sudo vim handler.yaml
      65    sudo vim handler.yaml
      66    vim handler.yaml
      67    sudo vim when.yml
      68    history
      69    ls
      70    sudo vim debug1.yaml
      71    ansible-playbook -b debug1.yaml
      72    sudo vim when.yaml
      73    ansible-playbook when.yaml
      74    sudo vim when1.yaml
      75    sudo rm when1.yaml
      76    ls
      77    sudo cp when.yaml when1.yaml
      78    sudo vim when1.yaml
      79    ansible-playbook when1.yaml
      80    sudo vim list.yaml
      81    ansible-playbook list.yaml
      82    sudo vim items.yaml
      83    ansible-playbook items.yaml
      84    ls
      85    ansible cible1 -bm shell -a "ls -lrt /home/ansadmin"
      86    ansible cible2 -bm shell -a "ls -lrt /home/ansadmin"
      87    ansible all -bm shell -a "ls -lrt /home/ansadmin"
      88    ansible all -bma "ls -lrt /home/ansadmin"
      89    ansible all -bm shell -a "ls -lrt /home/ansadmin"
      90    cp items.yaml seq.yaml
      91    sudo vim seq.yaml
      92    ansible-playbook seq.yaml
      93    ansible all -bm shell -a "ls -lrt /home/ansadmin"
      94    ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
      95    ansible all -bm group -a "name=rennes"
      96    ansible all -bm group -a "name=lille"
      97    ansible all -bm group -a "name=paris"
      98    ansible all -bm user -a "name=core"
      99    ansible all -bm user -a "name=core uid=10000"
    100    ansible all -bm user -a "name=core groups=rennes"
    101    ansible all -bm apt -a "name=tree state=latest"
    102    ansible all -bm service -a "name=cron state=stopped"
    103    ansible all -bm service -a "name=cron state=disabled"
    104    ansible all -bm service -a "name=cron enabled=no"
    105    ansible all -m file -a "path=/tmp/test.txt state=touch mode=0644"
    106    ansible all -m shell -a "ls -lrt /tmp/test.txt | grep test"
    107    ansible all -m shell -a "ls -lrt /tmp | grep test"
    108    ansible all -m directory -a "path=/tmp/dir state= mode=755"
    109    ansible all -m dir -a "path=/tmp/dir state= mode=755"
    110    ansible all -m file -a "path=/tmp/dir state=directory    mode=755"
    111    ansible all -bm apt -a "name=* state=latest"
    112    sudo vim exo2.yaml
    113    sudo vim exo3.yaml
    114    ansible-playbook exo3.yaml
    115    sudo vim exo3.yaml
    116    ansible-playbook exo3.yaml
    117    ansible-playbook exo3.yaml
    118    sudo vim exo3.yaml
    119    ansible-playbook exo3.yaml
    120    ansible -bm shell -a "id supervision"
    121    ansible -bm shell -a "cat /etc/passwd | grep super"
    122    ansible -b -m shell -a "cat /etc/passwd | grep super"
    123    ansible all -b -m shell -a "cat /etc/passwd | grep super"
    124    sudo vim exo4.yaml
    125    sudo vim exo4.yaml
    126    ansible-playbook exo4.yaml
    127    sudo vim exo4.yaml
    128    ansible-playbook exo4.yaml
    129    sudo vim exo4.yaml
    130    ansible-playbook exo4.yaml
    131    sudo vim exo4.yaml
    132    ansible-playbook exo4.yaml
    133    sudo vim exo4.yaml
    134    sudo vim when1.yaml
    135    sudo vim when.yaml
    136    sudo vim when1.yaml
    137    ansible-playbook when1.yaml
    138    sudo vim when1.yaml
    139    sudo vim rep.yaml
    140    ansible-playbook rep.yaml
    141    sudo vim rep.yaml
    142    ansible all -bm shell -a "ls -lrt /etc"
    143    ansible all -bm shell -a "ls -lrt /tmp"
    144    ansible all -bm shell -a "ls -lrt /etc | grep Deb"
    145    ansible-playbook rep.yaml
    146    ansible all -bm shell -a "ls -lrt /etc | grep Deb"
    147    ansible all -bm shell -a "ls -lrt /etc | grep redhat"
    148    ansible-playbook rep.yaml
    149    sudo vim rep.yaml
    150    ansible-playbook rep.yaml
    151    ansible all -bm shell -a "ls -lrt /tmp/redhat | grep redhat"
    152    ansible all -bm shell -a "ls -lrt /tmp/redhat"
    153    ansible all -bm shell -a "ls -lrt /tmp/Redhat"
    154    ansible-playbook list.yaml
    155    sudo vim list.yaml
    156    ansible-playbook list.yaml
    157    sudo vim template.yaml
    158    sudo vim items.yaml
    159    ansible-playbook items.yaml
    160    sudo vim items.yaml
    161    ansible all -bm shell -a "ls -lrt /home/ansadmin"
    162    sudo vim items_users.yaml
    163    sudo -f items_users.yaml
    164    rm items_users.yaml
    165    cp items.yaml item_users.yaml
    166    sudo vim items_users.yaml
    167    ls
    168    sudo vim item_users.yaml
    169    ls
    170    sudo vim exo3.yaml
    171    sudo vim item_users.yaml
    172    ansible-playbook item_users.yaml
    173    sudo vim item_users.yaml
    174    sudo vim items.yaml
    175    sudo vim item_users.yaml
    176    ansible-playbook item_users.yaml
    177    sudo vim items.yaml
    178    sudo vim item_users.yaml
    179    ansible-playbook item_users.yaml
    180    sudo vim exo3.yaml
    181    sudo vim item_users.yaml
    182    ansible-playbook item_users.yaml
    183    sudo vim item_users.yaml
    184    ansible-playbook item_users.yaml
    185    sudo vim seq.yaml
    186    ansible-playbook seq.yaml
    187    sudo vim rep.yaml
    188    sudo vim seq.yaml
    189    ansible all -bm shell -a "ls -lrt /home/ansadmin | Dev"
    190    ansible all -bm shell -a "ls -lrt /home/ansadmin | grep Dev"
    191    sudo vim copie.yaml
    192    ls
    193    sudo vim copie.yaml
    194    ls
    195    sudo vim copie.yaml
    196    sudo vim template.yaml
    197    ansible-playbook template.yaml
    198    sudo vim index.html.j2
    199    ansible-playbook template.yaml
    200    sudo vim template.yaml
    201    sudo vim index.html.j2
    202    ansible-playbook template.yaml
    203    sudo vim index.html.j2
    204    ansible-playbook template.yaml
    205    sudo vim index.html.j2
    206    ansible-playbook template.yaml
    207    sudo vim index.html.j2
    208    ansible-playbook template.yaml
    209    cp index.html.j2 index.html1.j2
    210    sudo vim index.html1.j2
    211    sudo vim index.html.j2
    212    ansible-playbook template.yaml
    213    sudo vim index.html.j2
    214    ansible-playbook template.yaml
    215    sudo vim index.html.j2
    216    sudo vim index.html1.j2
    217    sudo vim index.html.j2
    218    sudo vim index.html1.j2
    219    sudo vim index.html.j2
    220    sudo vim index.html1.j2
    221    cp template.yaml template1.yaml
    222    sudo vim template1.yaml
    223    ansible-playbook template1.yaml
    224    sudo vim template1.yaml
    225    ls
    226    sudo vim exo4.yaml
    227    sudo vim exo3.yaml
    228    sudo vim template1.yaml
    229    ansible-playbook template1.yaml
    230    sudo vim template1.yaml
    231    ansible-playbook template1.yaml
    232    sudo vim template1.yaml
    233    ansible-playbook template1.yaml
    234    sudo vim template1.yaml
    235    ansible-playbook template1.yaml
    236    sudo vim template1.yaml
    237    sudo vim template.yaml
    238    sudo vim template1.yaml
    239    ansible-playbook template1.yaml
    240    sudo vim template1.yaml
    241    ansible-playbook template1.yaml
    242    wq
    243    sudo vim template1.yaml
    244    ansible-vault create hello.yml
    245    ansible-vahello.yaml
    246    cat template1.yaml >> hello.yaml
    247    ansible-playbook hello.yaml
    248    ansible-playbook hello.yaml --ask-vault-pass
    249    ansible-vault edit
    250    ansible-vault create hello.yml
    251    sudo vim hello.yaml
    252    ansible-playbook hello.yaml --ask-vault-pass
    253    sudo vim hello.yaml
    254    ansible-playbook hello.yaml --ask-vault-pass
    255    sudo vim hello.yaml
    256    ansible-vault encrypt when2.yaml
    257    ansible-vault encrypt hello.yaml
    258    cat hello.yaml
    259    cat hello.yaml
    260    sudo vim play-vars.yaml
    261    ansible-playbook play-vars.yaml --ask-vault-pass
    262    ansible-vault create play-vars.yml
    263    cat play-vars.yaml >> play-vars.yml
    264    sudo vim play-vars.yml
    265    ansible-playbook play-vars.yml --ask-vault-pass
    266    sudo vim play-vars.yml
    267    ansible-playbook play-vars.yml --ask-vault-pass
    268    sudo vim play-vars.yml
    269    ansible-playbook play-vars.yml --ask-vault-pass
    270    sudo vim play-vars.yml
    271    ansible-playbook play-vars.yml --ask-vault-pass
    272    sudo vim locale.yml
    273    cat play-vars.yml >> locale.yml
    274    sudo cat play-vars.yml >> locale.yml
    275    sudo vim play-vars.yml
    276    sudo vim locale.yml
    277    ansible-playbook locale.yml
    278    sudo vim locale.yml
    279    ansible-playbook locale.yml
    280    sudo vim locale.yml
    281    sudo vim play-vars.yml
    282    sudo vim var_dic.yml
    283    ansible-playbook var_dic.yml
    284    sudo vim var_dic.yml
    285    ansible-playbook var_dic.yml
    286    cp var_dic.yml var_dic1.yml
    287    sudo vim var_dic1.yml
    288    ansible-playbook var_dic1.yml
    289    sudo vim var_dic1.yml
    290    ansible-playbook var_dic1.yml
    291    sudo vim var_dic1.yml
    292    ansible-playbook var_dic1.yml
    293    sudo vim var_dic1.yml
    294    ansible-playbook var_dic1.yml
    295    sudo vim var_dic1.yml
    296    ansible-playbook var_dic1.yml
    297    sudo vim var_dic1.yml
    298    ansible-playbook var_dic1.yml
    299    sudo vim var_dic1.yml
    300    ansible-playbook var_dic1.yml
    301    sudo vim var_dic1.yml
    302    ansible-playbook var_dic1.yml
    303    sudo vim var_dic1.yml
    304    ansible-playbook var_dic1.yml
    305    sudo vim var_dic1.yml
    306    ansible-playbook var_dic1.yml
    307    sudo vim var_dic1.yml
    308    ansible-playbook var_dic1.yml
    309    sudo vim var_dic1.yml
    310    ansible-playbook var_dic1.yml
    311    sudo vim var_dic1.yml
    312    ansible-playbook var_dic1.yml
    313    sudo vim var_dic1.yml
    314    ansible-playbook var_dic1.yml
    315    sudo vim var_dic1.yml
    316    ansible-playbook var_dic1.yml
    317    ansible-playbook var_dic1.yml
    318    cp vim var_dic1.yml var_dic2.yml
    319    cp var_dic1.yml var_dic2.yml
    320    sudo vim var_dic2.yml
    321    mv var_dic2.yml vars.yml
    322    sudo vim vars.yml
    323    sudo vim vars_files.yml
    324    mv var_dic2.yml vars.yml
    325    sudo vim var_dic2.yml
    326    mv var_dic1.yml var_dic2.yml
    327    sudo vim var_dic2.yml
    328    ansible-playbook var_dic2.yml
    329    sudo vim var_dic2.yml
    330    ansible-playbook var_dic2.yml
    331    ansible-playbook var_dic2.yml --extra-vars="type=web"
    332    sudo vim var_dic2.yml
    333    ls
    334    cp var_dic2.yml var_dic_multi3.yml
    335    sudo vim var_dic_multi3.yml
    336    sudo vim vars_multi.yml
    337    sudo vim var_dic_multi3.yml
    338    sudo vim var_dic2.yml
    339    sudo vim var_dic1.yml
    340    sudo vim var_dic2.yml
    341    sudo vim var_dic_multi3.yml
    342    ansible-playbook var_dic_multi3.yml
    343    sudo vim var_dic_multi3.yml
    344    ansible-playbook var_dic_multi3.yml
    345    sudo vim var_dic_multi3.yml
    346    sudo vim var_dic2.yml
    347    sudo vim var_dic_multi3.yml
    348    ansible-playbook var_dic_multi3.yml
    349    sudo vim var_dic_multi3.yml
    350    sudo vim vars_multi.yml
    351    sudo vim var_dic_multi3.yml
    352    ansible-playbook var_dic_multi3.yml
    353    sudo vim var_dic_multi3.yml
    354    ansible-playbook var_dic_multi3.yml
    355    sudo vim var_dic_multi3.yml
    356    ansible-playbook var_dic_multi3.yml
    357    sudo vim var_dic_multi3.yml
    358    cat var_dic_multi3.yml
    359    head var_dic_multi3.yml
    360    head -n20 var_dic_multi3.yml
    361    head -n30 var_dic_multi3.yml
    362    sudo vim var_dic_multi3.yml
    363    rm    var_dic_multi3.yml
    364    sudo vim var_dic_multi3.yml
    365    ansible-playbook var_dic_multi3.yml
    366    sudo vim vars.yml
    367    cp vim vars.yml vars2.yml
    368    sudo vim vars2.yml
    369    cp vars.yml vars2.yml
    370    sudo vim vars2.yml
    371    cp var_dic_multi3.yml var_dic_multi4.yml
    372    sudo vim var_dic_multi4.yml
    373    ls
    374    sudo vim var_dic.yml
    375    sudo vim var_dic2.yml
    376    sudo vim var_dic_multi4.yml
    377    sudo vim var_dic.yml
    378    sudo vim var_dic_multi4.yml
    379    sudo vim var_dic.yml
    380    sudo vim var_dic2.yml
    381    sudo vim var_dic_multi4.yml
    382    ansible-playbook var_dic_multi4.yml
    383    sudo vim var_dic_multi4.yml
    384    ansible-playbook var_dic_multi4.yml
    385    sudo vim var_dic_multi4.yml
    386    ansible-playbook var_dic_multi4.yml
    387    sudo vim var_dic_multi4.yml
    388    sudo vim vars2.yml
    389    sudo vim var_dic_multi4.yml
    390    ansible-playbook var_dic_multi4.yml
    391    sudo vim var_dic_multi4.yml
    392    ansible-playbook var_dic_multi4.yml
    393    sudo vim var_dic_multi4.yml
    394    ansible-playbook var_dic_multi4.yml
    395    sudo vim var_dic_multi4.yml
    396    ansible-playbook var_dic_multi4.yml
    397    sudo vim var_dic_multi4.yml
    398    ansible-playbook var_dic_multi4.yml
    399    sudo vim var_dic_multi4.yml
    400    ansible-playbook var_dic_multi4.yml
    401    sudo vim var_dic_multi4.yml
    402    ansible-playbook var_dic_multi4.yml
    403    sudo vim var_dic_multi4.yml
    404    ansible-playbook var_dic_multi4.yml
    405    sudo vim var_dic_multi4.yml
    406    ansible-playbook var_dic_multi4.yml
    407    sudo vim var_dic_multi4.yml
    408    ansible-playbook var_dic_multi4.yml
    409    q
    410    sudo vim var_dic_multi4.yml
    411    ansible-playbook var_dic_multi4.yml
    412    sudo vim var_dic_multi4.yml
    413    ansible-playbook var_dic_multi4.yml
    414    sudo vim var_dic_multi4.yml
    415    ansible-playbook var_dic_multi4.yml
    416    sudo vim var_dic_multi4.yml
    417    ansible-playbook var_dic_multi4.yml
    418    sudo vim vars2.yml
    419    sudo vim var_dic_multi4.yml
    420    ansible-playbook var_dic_multi4.yml
    421    sudo vim var_dic_multi4.yml
    422    ansible-playbook var_dic_multi4.yml --extra-vars "type=web"
    423    ansible-playbook var_dic_multi4.yml --extra-vars "type=db"
    424    sudo vim var_dic_multi4.yml
    425    ansible-playbook var_dic_multi4.yml --extra-vars "type=db"
    426    ansible-playbook var_dic_multi4.yml --extra-vars "type=web"
    427    sudo vim var_dic_multi4.yml
    428    ansible-playbook var_dic_multi4.yml --extra-vars "type=web"
    429    sudo vim group.yml
    430    mv vim group.yml inventory.yaml
    431    mv group.yml inventory.yaml
    432    ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
    433    ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
    434    sudo vim inventory.yaml
    435    ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
    436    sudo vim inventory.yaml
    437    ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
    438    sudo vim inventory.yaml
    439    tree
    440    mkdir host_vars
    441    mkdir group_vars
    442    mkdir projet
    443    mv inventory.yaml var_dic_multi4.yml host_vars group_vars projet/
    444    cd projet/
    445    cd
    446    sudo vim vars2.yml
    447    cp vars2.yml projet/
    448    cd projet/
    449    ls -lrt
    450    mv var_dic_multi4.yml install.yaml
    451    ls -lrt
    452    mv vars2.yml vars_install.yaml
    453    ls -lrt
    454    sudo vim inventory.yaml
    455    cd group_vars/
    456    sudo vim port.yaml
    457    mv port.yaml cible1.yaml
    458    cp cible1.yaml cible2.yaml
    459    cd ..
    460    tree
    461    ansible-playbook -i inventory.yaml var_dic_multi4.yml --extra-vars
"type=web"
    462    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    463    sudo vim inventory.yaml
    464    sudo vim install.yaml
    465    ls -lrt
    466    cd group_vars/
    467    ls
    468    sudo vim cible1.yaml
    469    sudo vim cible2.yaml
    470    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    471    cd
    472    cd projet/
    473    ls
    474    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    475    cd projet/
    476    cd group_vars/
    477    sudo vim cible1.yaml
    478    sudo vim cible2.yaml
    479    cd ..
    480    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    481    cd host_vars/
    482    sudo vim client1.yaml
    483    sudo vim client2.yaml
    484    cd ..
    485    sudo vim install.yaml
    486    cd host_vars/
    487    ls
    488    cd ..
    489    sudo vim inventory.yaml
    490    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    491    sudo vim install.yaml
    492    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    493    cd host_vars/
    494    sudo vim client1.yaml
    495    sudo vim client2.yaml
    496    cd ..
    497    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    498    sudo vim install.yaml
    499    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    500    sudo vim install.yaml
    501    cd host_vars/
    502    ls
    503    ll
    504    cd ..
    505    cd group_vars/
    506    ls
    507    sudo vim cible1.yaml
    508    cd ..
    509    cd host_vars/
    510    ls
    511    sudo vim client1.yaml
    512    sudo vim client2.yaml
    513    cd ..
    514    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    515    sudo vim install.yaml
    516    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    517    sudo vim install.yaml
    518    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    519    sudo vim install.yaml
    520    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    521    sudo vim install.yaml
    522    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    523    sudo vim install.yaml
    524    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    525    sudo vim install.yaml
    526    cd
    527    sudo vim debug.yaml
    528    cd projet/
    529    sudo vim install.yaml
    530    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    531    sudo vim install.yaml
    532    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    533    sudo vim inventory.yaml
    534    cd group_vars/
    535    ls
    536    sudo vim cible1.yaml
    537    sudo vim cible2.yaml
    538    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    539    cd ..
    540    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    541    sudo vim install.yaml
    542    cd host_vars/
    543    ls
    544    sudo vim client1.yaml
    545    sudo vim client2.yaml
    546    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    547    cd ..
    548    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    549    sudo vim install.yaml
    550    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    551    sudo vim install.yaml
    552    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    553    cd host_vars/
    554    ls
    555    sudo vim client1.yaml
    556    sudo vim client2.yaml
    557    cd ..
    558    cd group_vars/
    559    ls
    560    sudo vim cible1.yaml
    561    sudo vim cible2.yaml
    562    cd ..
    563    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    564    sudo vim install.yaml
    565    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    566    sudo vim install.yaml
    567    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    568    sudo vim install.yaml
    569    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    570    sudo vim install.yaml
    571    ansible-playbook -i inventory.yaml install.yaml --extra-vars "type=web"
    572    ll
    573    tree
    574    cd
    575    mkdir projet1
    576    cd projet1
    577    mkdir roles
    578    cd roles/
    579    mkdir apache
    580    cd apache/
    581    tree
    582    pwd
    583    mkdir tasks vars templates handlers
    584    tree
    585    touch tasks/main.yml
    586    touch vars/main.yml
    587    touch handlers/main.yml
    588    tree
    589    sudo vim tasks/main.yml
    590    sudo vim vars/main.yml
    591    sudo vim templates/index.html.j2
    592    cd ..
    593    sudo vim hosts.yml
    594    sudo vim templates/index.html.j2
    595    cd roles/apache
    596    sudo vim templates/index.html.j2
    597    sudo vim vars/main.yml
    598    cd ..
    599    ansible-playbook -i hosts.yml site.yml
    600    sudo vim hosts.yml
    601    ansible-playbook -i hosts.yml site.yml
    602    tree
    603    curl client1
    604    tree
    605    mkdir group_vars
    606    mkdir hosts_vars
    607    cat roles/apache/tasks/main.yml
    608    cat roles/apache/handlers/main.yml
    609    cat roles/apache/vars/main.yml
    610    cat roles/apache/templates/index.html.j2
    611    sudo vim site.yml
    612    ansible-playbook -i hosts.yml site.yml
    613    sudo vim roles/apache/vars/main.yml
    614    ansible-playbook -i hosts.yml site.yml
    615    sudo vim roles/apache/vars/main.yml
    616    tree
    617    ansible-playbook -i hosts.yml site.yml
    618    cat roles/apache/templates/index.html.j2
    619    sudo vim roles/apache/vars/main.yml
    620    cat roles/apache/templates/index.html.j2
    621    ansible-playbook -i hosts.yml site.yml
    622    sudo vim roles/apache/tasks/main.yml
    623    ansible-playbook -i hosts.yml site.yml
    624    tree
    625    ansible-playbook -i hosts.yml site.yml
    626    sudo vim roles/apache/vars/main.yml
    627    ansible-playbook -i hosts.yml site.yml
    628    cd
    629    sudo vim /etc/hosts
    630    cd projet1/
    631    ansible-playbook -i hosts.yml site.yml
    632    tree
    633    cat hosts.yml
    634    ansible-playbook -i hosts.yml site.yml
    635    cd
    636    sudo vim /etc/hosts
    637    cd projet1/
    638    ansible -i hosts.yml client1 -m ping
    639    cd roles/
    640    ls
    641    cd apache/
    642    ls
    643    sudo vim vars/main.yml
    644    sudo vim handlers/main.yml
    645    sudo vim templates/index.html.j2
    646    cd ..
    647    ll
    648    cd ..
    649    ll
    650    sudo vim site.yml
    651    ansible-playbook -i hosts.yml site.yml
    652    ansible -i hosts.yml client1 -m ping
    653    tree
    654    cd group_vars/
    655    ls
    656    sudo vim all.yml
    657    cd ..
    658    ansible -i hosts.yml client1 -m ping
    659    ansible-playbook -i hosts.yml site.yml
    660    cd
    661    ansible all -m service -a "name=nginx state= stopped"
    662    sudo vim projet1/roles/apache/vars/
    663    sudo vim projet1/roles/apache/vars/main.yml
    664    cd projet1
    665    tree
    666    cd group_vars/
    667    sudo vim all.yml
    668    cd ..
    669    ansible all -bm service -a "name=nginx state=stopped"
    670    ansible-playbook -i hosts.yml site.yml
    671    tree
    672    sudo vim hosts.yml
    673    curl client1
    674    cd roles/
    675    ls
    676    cp -r apache users
    677    ls
    678    cd users
    679    ls -lrt
    680    tree
    681    cd ..
    682    tree
    683    ll
    684    cd users/
    685    ls
    686    ls -lrt
    687    sudo vim vars/main.yml
    688    sudo vim templates/index.html.j2
    689    sudo vim tasks/main.yml
    690    cd
    691    ls
    692    sudo vim item_users.yaml
    693    cd projet1/roles/users/
    694    sudo vim tasks/main.yml
    695    tree
    696    sudo vim vars/main.yml
    697    cd ..
    698    tree
    699    cd roles/
    700    cd users/
    701    sudo vim vars/main.yml
    702    cd
    703    ls
    704    cd projet
    705    ls
    706    sudo vim vars_install.yaml
    707    cd
    708    cd projet1/roles/users/vars/
    709    sudo vim vars/main.yml
    710    sudo main.yml
    711    sudo vim main.yml
    712    cd ..
    713    ansible-playbook -i hosts.yml site.yml
    714    cd ..
    715    ansible-playbook -i hosts.yml site.yml
    716    cd roles/
    717    ansible-playbook -i hosts.yml site.yml
    718    ls
    719    mv users /home/ansadmin/
    720    cd
    721    ls
    722    mv users projet2
    723    cd projet2
    724    ls
    725    tree
    726    mkdir roles
    727    cd ..
    728    ls
    729    cd projet2
    730    ls
    731    mv handlers tasks templates vars roles/
    732    ls
    733    cd roles/
    734    ls
    735    mkdir user
    736    ls
    737    mv handlers tasks templates vars user/
    738    cd ..
    739    tree
    740    sudo vim roles/user/handlers/main.yml
    741    cd
    742    cd projet1/
    743    ls
    744    cp group_vars hosts_vars hosts.yml site.yml ../projet2
    745    cp -r group_vars hosts_vars hosts.yml site.yml ../projet2
    746    cd ..
    747    cd projet2
    748    tree
    749    ansible-playbook -i hosts.yml site.yml
    750    tree
    751    sudo vim site.yml
    752    ansible-playbook -i hosts.yml site.yml
    753    sudo vim roles/user/tasks/main.yml
    754    ansible-playbook -i hosts.yml site.yml
    755    sudo vim roles/user/tasks/main.yml
    756    cd
    757    ls
    758    sudo vim var_dic_multi3.yml
    759    cd projet2
    760    sudo vim roles/user/tasks/main.yml
    761    ansible-playbook -i hosts.yml site.yml
    762    sudo vim roles/user/tasks/main.yml
    763    tree
    764    sudo vim roles/user/vars/main.yml
    765    ansible-playbook -i hosts.yml site.yml
    766    sudo vim roles/user/tasks/main.yml
    767    ansible-playbook -i hosts.yml site.yml
    768    sudo vim roles/user/tasks/main.yml
    769    ansible-playbook -i hosts.yml site.yml
    770    sudo vim roles/user/tasks/main.yml
    771    ansible-playbook -i hosts.yml site.yml
    772    sudo vim roles/user/tasks/main.yml
    773    ansible-playbook -i hosts.yml site.yml
    774    sudo vim roles/user/tasks/main.yml
    775    ansible-playbook -i hosts.yml site.yml
    776    sudo vim roles/user/tasks/main.yml
    777    ansible-playbook -i hosts.yml site.yml
    778    sudo vim roles/user/tasks/main.yml
    779    ansible-playbook -i hosts.yml site.yml
    780    sudo vim roles/user/tasks/main.yml
    781    tree
    782    sudo vim site.yml
    783    ansible-playbook -i hosts.yml site.yml
    784    sudo vim hosts.yml
    785    tree
    786    cd roles
    787    mv user/ users/
    788    cd ..
    789    tree
    790    sudo vim site.yml
    791    sudo vim roles/user/tasks/main.yml
    792    sudo vim roles/users/tasks/main.yml
    793    sudo vim roles/users/templates/index.html.j2
    794    sudo vim hosts.yml
    795    sudo vim site.yml
    796    sudo vim roles/users/vars/main.yml
    797    ansible-playbook -i hosts.ymlsite.yml
    798    ansible-playbook -i hosts.yml site.yml
    799    sudo vim roles/users/tasks/main.yml
    800    ansible-playbook -i hosts.yml site.yml
    801    sudo vim roles/users/tasks/main.yml
    802    ansible-playbook -i hosts.yml site.yml
    803    tree
    804    ansible-playbook -i hosts.yml site.yml
    805    sudo vim roles/users/vars/main.yml
    806    sudo vim roles/users/templates/index.html.j2
    807    ansible-playbook -i hosts.yml site.yml
    808    sudo vim roles/users/tasks/main.yml
    809    ansible-playbook -i hosts.yml site.yml
    810    sudo vim roles/users/tasks/main.yml
    811    ansible-playbook -i hosts.yml site.yml
    812    sudo vim roles/users/tasks/main.yml
    813    ansible-playbook -i hosts.yml site.yml
    814    cd
    815    ansible-galaxy init projet3
    816    cd projet3
    817    tree
    818    cd
    819    ansible-galaxy install projet3 geerlingguy.apache
    820    ansible-galaxy install geerlingguy.apache
    821    mkdir projet4
    822    ansible-galaxy install geerlingguy.apache -p projet4
    823    cd projet4
    824    tree
    825    cd geerlingguy.apache
    826    ls -lrt
    827    cd tasks/
    828    ls
    829    sudo vim main.yml
    830    cd ..
    831    tree
    832    cd
    833    tree
    834    ansible-playbook -i projet
    835    cd projet4/geerlingguy.apache/
    836    sudo vim site.yml
    837    cd
    838    cd projet2
    839    ls
    840    cp hosts.yml ../projet4/
    841    cd
    842    cd projet4
    843    ansible-playbook -i hosts.yml site.yml
    844    tree
    845    :q
    846    cd
    847    cd projet2
    848    cp site.yml ../projet4/
    849    cd
    850    cd projet4
    851    ansible-playbook -i hosts.yml site.yml
    852    tree
    853    sudo vim site.yml
    854    ansible-playbook -i hosts.yml site.yml
    855    tree
    856    sudo vim site.yml
    857    sudo vim hosts.yml
    858    ansible-playbook -i hosts.yml site.yml
    859    cd
    860    cd projet2
    861    ls
    862    cp -r group_vars hosts_vars ../projet4/
    863    cd
    864    cd projet4
    865    ansible-playbook -i hosts.yml site.yml
    866    tree
    867    history
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook -i hosts.yml .yml
.ansible/                      TP3/                                fact.yaml         
item_users.yaml          projet1/
.bash_history              TPansible/                    fact1.yaml                 
items.yaml                    projet2/
.bash_logout                cible1.txt                    handler.yaml               
items_users.yaml        projet3/
.bashrc                          copie.yaml                    hello.yaml           
list.yaml                      projet4/
.exo4.yaml.swp            debug.yaml                    hello.yml                   
locale.yml                    rep.yaml
.handler.yaml.swp      debug1.yaml                  index.html                   
nginx.yaml                    seq.yaml
.profile                        exo2.yaml                      index.html.j2         
play-vars.yaml            shell.yml
.ssh/                              exo3.yaml                      index.html1.j2     
play-vars.yml              snap/
.viminfo                        exo4.yaml                      ip.txt               
projet/                          template.yaml
ansadmin@svl200:~$ ansible-playbook -i hosts.yml main.yml -u apx28
ERROR! the playbook: main.yml could not be found
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
ok: [141.95.160.128]

TASK [montage]
*********************************************************************************
ok: [141.95.160.128]
PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=0        unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main.yml


ansadmin@svl200:~/TPansible$ sudo vim main.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
ok: [141.95.160.128]

TASK [montage]
*********************************************************************************
ok: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=5      changed=0        unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    main.yml    roles    site.yml
ansadmin@svl200:~/TPansible$ sudo vim main.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main.yml -u apx28

PLAY [partition lvm]


***************************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [141.95.160.128]

TASK [partition1]
******************************************************************************
ok: [141.95.160.128]
TASK [creation de fichier]
*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
changed: [141.95.160.128]

TASK [montage]
*********************************************************************************
changed: [141.95.160.128]

TASK [partition2]
******************************************************************************
changed: [141.95.160.128]

TASK [creation de fichier]


*********************************************************************
ok: [141.95.160.128]

TASK [filesystem]
******************************************************************************
changed: [141.95.160.128]

TASK [montage]
*********************************************************************************
changed: [141.95.160.128]

PLAY RECAP
*************************************************************************************
141.95.160.128                          : ok=9      changed=5      unreachable=0   
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    main.yml    roles    site.yml
ansadmin@svl200:~/TPansible$ sudo vim main_base.yml
ansadmin@svl200:~/TPansible$ cat main.yml
---
- name: partition lvm
    hosts: all
    become: true

    tasks:
        - name: partition1
            lvol:
                vg: datavg
                lv: ansible_lv1_aaw
                size: 250M
                force: yes

        - name: creation de fichier


            file:
                    path: /tp3_aaw
                    state: directory
                    mode: 755

        - name: filesystem
            filesystem:
                fstype: xfs
                dev: /dev/datavg/ansible_lv1_aaw

        - name: montage
            mount:
                  path: /tp3_aaw
                  src: /dev/datavg/ansible_lv1_aaw
                  fstype: xfs
                  state: mounted

        - name: partition2
            lvol:
                vg: datavg
                lv: ansible_lv2_aaw
                size: 250M
                force: yes

        - name: creation de fichier


            file:
                    path: /tp3_aaw
                    state: directory
                    mode: 755

        - name: filesystem
            filesystem:
                fstype: xfs
                dev: /dev/datavg/ansible_lv2_aaw

        - name: montage
            mount:
                  path: /tp3_aaw
                  src: /dev/datavg/ansible_lv2_aaw
                  fstype: xfs
                  state: mounted

ansadmin@svl200:~/TPansible$ ^C
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_base.yml
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ sudo vim hosts.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_.yml -u apx28
main_base.yml            main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml -u apx28

PLAY [install postgresql on Ubuntu or Debian]


**************************************************

TASK [Gathering Facts]


*************************************************************************
fatal: [146.59.158.16]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect
to the hostssion denied (publickey,password).", "unreachable": true}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=0        changed=0        unreachable=1
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql on Ubuntu or Debian]


**************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [debug]
***********************************************************************************
ok: [146.59.158.16] => {
        "msg": "play_hosts=['146.59.158.16']"
}

TASK [debug]
***********************************************************************************
ok: [146.59.158.16] => {
        "msg": "ansible_distribution=Ubuntu"
}

TASK [postgresql key]


**************************************************************************
changed: [146.59.158.16]

TASK [create variable]


*************************************************************************
changed: [146.59.158.16]

TASK [debug]
***********************************************************************************
ok: [146.59.158.16] => {
        "msg": "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main"
}

TASK [add postgresql repo]


*********************************************************************
changed: [146.59.158.16]

TASK [install postgresql]


**********************************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variabon' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/main_postgres.yml': line in the file depending on the exact
syntax problem.\n\nThe offending line appears to be:\n\n\n ere\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=7      changed=3      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ sudo vim main_base.yml
ansadmin@svl200:~/TPansible$ ls
group_vars    hosts.yml    hosts_vars    main.yml    main_base.yml   
main_postgres.yml    roles    site.yml
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql on Ubuntu or Debian]


**************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=2      changed=0        unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'posgresql' is

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************
TASK [Gathering Facts]
*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "Unsupported parameters
for (apt_ke include: data, file, id, key, keyring, keyserver, state, url,
validate_certs"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'posgresql' is

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=1      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
changed: [146.59.158.16]

TASK [package_python]
**************************************************************************
changed: [146.59.158.16]
TASK [acl]
*************************************************************************************
changed: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "No package matching
'posgresql' is

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=4      changed=3      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
changed: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=6      changed=1      unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ sudo vim main_houcem.yml
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
changed: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=2      unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ cp /home/ofi03/psql.yml /home/ofi03/dump.sql .
ansadmin@svl200:~/TPansible$ ls
dump.sql        hosts.yml      main.yml              main_houcem.yml        psql.yml 
site.yml
group_vars    hosts_vars    main_base.yml    main_postgres.yml    roles
ansadmin@svl200:~/TPansible$ sudo vim psql.yml
ansadmin@svl200:~/TPansible$ sudo vim dump.sql
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml
ERROR! Syntax Error while loading YAML.
    did not find expected key
The error appears to be in '/home/ansadmin/TPansible/psql.yml': line 3, column 6, but
may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        - name: Install dependencies for PostgreSQL


          apt: name={{ item }} update_cache=true state=latest
          ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

        with_items:
            - {{ foo }}

Should be written as:

        with_items:
            - "{{ foo }}"
ansadmin@svl200:~/TPansible$ sudo vim psql.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml
ERROR! A playbook must be a list of plays, got a <class
'ansible.parsing.yaml.objects.AnsibleMap

The error appears to be in '/home/ansadmin/TPansible/psql.yml': line 1, column 1, but


may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:
^ here
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ sudo vim psql.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [Install dependencies for PostgreSQL]


*****************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['b
'libssl-dev', 'libssl-doc']` and remove the loop. This feature will be removed in
version 2.11.
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [146.59.158.16] => (item=['bash', 'openssl', 'libssl-dev', 'libssl-doc'])

TASK [Install PostgreSQL]


**********************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['p
'postgresql-contrib', 'libpq-dev', 'python3-psycopg2']` and remove the loop. This
feature will b
version 2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansi
changed: [146.59.158.16] => (item=['postgresql', 'postgresql-contrib', 'libpq-dev',
'python3-psy

TASK [Ensure the PostgreSQL service is running]


************************************************
ok: [146.59.158.16]

TASK [Create the database specified in vars]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/psql.yml': line may\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appea name: Create the database
specified in vars\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=4      changed=2      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim psql.yml


ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [Install dependencies for PostgreSQL]


*****************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['b
'libssl-dev', 'libssl-doc']` and remove the loop. This feature will be removed in
version 2.11.
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [146.59.158.16] => (item=['bash', 'openssl', 'libssl-dev', 'libssl-doc'])

TASK [Install PostgreSQL]


**********************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['p
'postgresql-contrib', 'libpq-dev', 'python3-psycopg2']` and remove the loop. This
feature will b
version 2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansi
ok: [146.59.158.16] => (item=['postgresql', 'postgresql-contrib', 'libpq-dev',
'python3-psycopg2

TASK [Ensure the PostgreSQL service is running]


************************************************
ok: [146.59.158.16]

TASK [Create the database specified in vars]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/psql.yml': line may\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appea name: Create the database
specified in vars\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=4      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim psql.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [Install dependencies for PostgreSQL]


*****************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['b
'libssl-dev', 'libssl-doc']` and remove the loop. This feature will be removed in
version 2.11.
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [146.59.158.16] => (item=['bash', 'openssl', 'libssl-dev', 'libssl-doc'])

TASK [Install PostgreSQL]


**********************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['p
'postgresql-contrib', 'libpq-dev', 'python3-psycopg2']` and remove the loop. This
feature will b
version 2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansi
ok: [146.59.158.16] => (item=['postgresql', 'postgresql-contrib', 'libpq-dev',
'python3-psycopg2

TASK [Ensure the PostgreSQL service is running]


************************************************
ok: [146.59.158.16]

TASK [Create the database specified in vars]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/psql.yml': line may\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appea name: Create the database
specified in vars\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=4      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim psql.yml


ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [Install dependencies for PostgreSQL]


*****************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['b
'libssl-dev', 'libssl-doc']` and remove the loop. This feature will be removed in
version 2.11.
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [146.59.158.16] => (item=['bash', 'openssl', 'libssl-dev', 'libssl-doc'])

TASK [Install PostgreSQL]


**********************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['p
'postgresql-contrib', 'libpq-dev', 'python3-psycopg2']` and remove the loop. This
feature will b
version 2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansi
ok: [146.59.158.16] => (item=['postgresql', 'postgresql-contrib', 'libpq-dev',
'python3-psycopg2

TASK [Ensure the PostgreSQL service is running]


************************************************
ok: [146.59.158.16]

TASK [Create the database specified in vars]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/psql.yml': line may\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appea name: Create the database
specified in vars\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=4      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml dump.sql

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [Install dependencies for PostgreSQL]


*****************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['b
'libssl-dev', 'libssl-doc']` and remove the loop. This feature will be removed in
version 2.11.
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [146.59.158.16] => (item=['bash', 'openssl', 'libssl-dev', 'libssl-doc'])

TASK [Install PostgreSQL]


**********************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions
is depreca
using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use
`name: ['p
'postgresql-contrib', 'libpq-dev', 'python3-psycopg2']` and remove the loop. This
feature will b
version 2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansi
ok: [146.59.158.16] => (item=['postgresql', 'postgresql-contrib', 'libpq-dev',
'python3-psycopg2

TASK [Ensure the PostgreSQL service is running]


************************************************
ok: [146.59.158.16]

TASK [Create the database specified in vars]


***************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/psql.yml': line may\nbe elsewhere in the file depending on
the exact syntax problem.\n\nThe offending line appea name: Create the database
specified in vars\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=4      changed=0        unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]
PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim psql.yml
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml dump.sql

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/main_postgres.ymn 5, but may\nbe elsewhere in the file
depending on the exact syntax problem.\n\nThe offending l\n\n\n    - name: Add some
dummy data to our database\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml dump.sql

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"msg": "The task includes an option with an
undefined variab 'db_name' is undefined\n\nThe error appears to be in
'/home/ansadmin/TPansible/main_postgres.ymn 5, but may\nbe elsewhere in the file
depending on the exact syntax problem.\n\nThe offending l\n\n\n    - name: Add some
dummy data to our database\n        ^ here\n"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml dump.sql

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": true, "cmd": "psql dbofi <
/tmp/dump.sql", "delta", "end": "2022-10-06 13:11:15.012221", "msg": "non-zero return
code", "rc": 2, "start": "2022-133", "stderr": "/bin/sh: 1: cannot open
/tmp/dump.sql: No such file", "stderr_lines": ["/bin/sh:mp/dump.sql: No such file"],
"stdout": "", "stdout_lines": []}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": true, "cmd": "psql dbofi <
/tmp/dump.sql", "delta", "end": "2022-10-06 13:11:59.191666", "msg": "non-zero return
code", "rc": 2, "start": "2022-149", "stderr": "/bin/sh: 1: cannot open
/tmp/dump.sql: No such file", "stderr_lines": ["/bin/sh:mp/dump.sql: No such file"],
"stdout": "", "stdout_lines": []}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
PLAY [install postgresql and BD]
***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": true, "cmd": "psql dbofi < dump.sql",
"delta": "0nd": "2022-10-06 13:13:33.478163", "msg": "non-zero return code", "rc": 2,
"start": "2022-10-06 "stderr": "/bin/sh: 1: cannot open dump.sql: No such file",
"stderr_lines": ["/bin/sh: 1: cannot such file"], "stdout": "", "stdout_lines": []}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ls
dump.sql        hosts.yml      main.yml              main_houcem.yml        psql.yml 
site.yml
group_vars    hosts_vars    main_base.yml    main_postgres.yml    roles
ansadmin@svl200:~/TPansible$ pwd
/home/ansadmin/TPansible
ansadmin@svl200:~/TPansible$ ^C
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": true, "cmd": "psql dbofi <
/home/ansadmin/TPansibta": "0:00:00.003189", "end": "2022-10-06 13:15:23.043889",
"msg": "non-zero return code", "rc":-10-06 13:15:23.040700", "stderr": "/bin/sh: 1:
cannot open /home/ansadmin/TPansible/dump.sql: Nerr_lines": ["/bin/sh: 1: cannot open
/home/ansadmin/TPansible/dump.sql: No such file"], "stdoutes": []}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ls
dump.sql        hosts.yml      main.yml              main_houcem.yml        psql.yml 
site.yml
group_vars    hosts_vars    main_base.yml    main_postgres.yml    roles
ansadmin@svl200:~/TPansible$ mv dump.sql dump.yml
ansadmin@svl200:~/TPansible$ ls
dump.yml        hosts.yml      main.yml              main_houcem.yml        psql.yml 
site.yml
group_vars    hosts_vars    main_base.yml    main_postgres.yml    roles
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": true, "cmd": "psql dbofi <
/home/ansadmin/TPansibta": "0:00:00.003190", "end": "2022-10-06 13:17:06.832266",
"msg": "non-zero return code", "rc":-10-06 13:17:06.829076", "stderr": "/bin/sh: 1:
cannot open /home/ansadmin/TPansible/dump.yml: Nerr_lines": ["/bin/sh: 1: cannot open
/home/ansadmin/TPansible/dump.yml: No such file"], "stdoutes": []}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ ^C
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": true, "cmd": "psql dbofi <
/home/ansadmin/TPansibta": "0:00:00.003628", "end": "2022-10-06 13:22:28.446963",
"msg": "non-zero return code", "rc":-10-06 13:22:28.443335", "stderr": "/bin/sh: 1:
cannot open /home/ansadmin/TPansible/dump.yml: Nerr_lines": ["/bin/sh: 1: cannot open
/home/ansadmin/TPansible/dump.yml: No such file"], "stdoutes": []}
PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=8      changed=1      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ sudo vim /etc/ansible/ansible.cfg
ansadmin@svl200:~/TPansible$ sudo vim /etc/ansible/ansible.cfg
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=9      changed=2      unreachable=0 
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "cmd": "/usr/bin/pg_dump dbofi
--port=5432es > /tmp/dbofi.sql", "msg": "pg_dump: error: connection to server on
socket \"/var/run/postgres failed: FATAL:    Peer authentication failed for
user \"postgres\"\n", "rc": 1, "stdout": "", "st
PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=9      changed=2      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

The error appears to be in '/home/ansadmin/TPansible/main_postgres.yml': line 57,


column 13, but
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: package_python
            target: /tmp/dbofi.sql
                        ^ here
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
ERROR! this task 'target' has extra params, which is only allowed in the following
modules: incl set_fact, raw, shell, include, add_host, import_role, win_command,
meta, include_vars, command,ort_tasks, win_shell, group_by

The error appears to be in '/home/ansadmin/TPansible/main_postgres.yml': line 56,


column 5, but
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

            state: pg_dump
    - name: package_python
        ^ here
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "msg": "value of state must be
one of: abs, restore, got: pg_dump"}

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=9      changed=2      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "cmd": "/usr/bin/pg_dump dbofi
--port=5432es > /tmp/dbofi.sql", "msg": "pg_dump: error: connection to server on
socket \"/var/run/postgres failed: FATAL:    Peer authentication failed for
user \"postgres\"\n", "rc": 1, "stdout": "", "st

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=9      changed=2      unreachable=0 
failed=1      skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
changed: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=10    changed=3      unreachable=0   
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ cat
dump.yml                      hosts_vars/                main_houcem.yml       
roles/
group_vars/                main.yml                      main_postgres.yml   
site.yml
hosts.yml                    main_base.yml            psql.yml
ansadmin@svl200:~/TPansible$ cat main_postgres.yml
- name: install postgresql and BD
    hosts: cible1
    become: yes
    become_method: sudo
    gather_facts: yes

    tasks:
    - name: installation postgresql-contrib
        apt:
            name: postgresql-contrib
            state: latest

    - name: package_python
        apt:
            name: python3-psycopg2
            state: latest

    - name: acl
        apt:
            name: acl
            state: latest

    - name: installation postgresql


        apt:
            name: postgresql
            state: present

    - name: start servicde


        service:
            name: postgresql
            state: started
            enabled: true

    - name: BD
        postgresql_db:
            state: present
            name: dbofi
        become: true
        become_user: postgres

    - name: start servicde


        service:
            name: postgresql
            state: restarted
            enabled: true

    - name: Add some dummy data to our database


        become: true
        become_user: postgres
        shell: psql dbofi < /home/ansadmin/dump.sql

    - name: sauvegarde
        postgresql_db:
            name: dbofi
            state: dump
            target: /tmp/dbofi_aaw.sql
        become: true
        become_user: postgres
        tags: dump
ansadmin@svl200:~/TPansible$ ^C
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************
TASK [Gathering Facts]
*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
changed: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=12    changed=5      unreachable=0   
failed=0        skipped=0        resc
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
changed: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [Import BD]


*******************************************************************************
changed: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=12    changed=4      unreachable=0   
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml


ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml

PLAY [install postgresql and BD]


***************************************************************

TASK [Gathering Facts]


*************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql-contrib]


*********************************************************
ok: [146.59.158.16]

TASK [package_python]
**************************************************************************
ok: [146.59.158.16]

TASK [acl]
*************************************************************************************
ok: [146.59.158.16]

TASK [installation postgresql]


*****************************************************************
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
ok: [146.59.158.16]

TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [start servicde]


**************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database]


*****************************************************
changed: [146.59.158.16]

TASK [sauvegarde]
******************************************************************************
changed: [146.59.158.16]
TASK [BD]
*************************************************************************************
*
ok: [146.59.158.16]

TASK [Import BD]


*******************************************************************************
changed: [146.59.158.16]

TASK [Add some dummy data to our database dbapx]


***********************************************
changed: [146.59.158.16]

PLAY RECAP
*************************************************************************************
146.59.158.16                            : ok=13    changed=5      unreachable=0   
failed=0        skipped=0        resc

ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ls
dump.yml        hosts.yml      main.yml              main_houcem.yml        psql.yml 
site.yml
group_vars    hosts_vars    main_base.yml    main_postgres.yml    roles
ansadmin@svl200:~/TPansible$ cd roles
ansadmin@svl200:~/TPansible/roles$ ls
users
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$ ls
users
ansadmin@svl200:~/TPansible/roles$ cp -r users postgres
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$ ls
postgres    users
ansadmin@svl200:~/TPansible/roles$    - name: BD
    - name: Import BD
        become: true
        become_user: postgres
        shell: psql dbapx < /tmp/dbofi_aaw.sql

    - name: Add some dummy data to our database dbapx


        become: true
        become_user: postgres
        shell: psql dbapx < /home/ansadmin/dump.sql
-: command not found
ansadmin@svl200:~/TPansible/roles$          postgresql_db:
postgresql_db:: command not found
ansadmin@svl200:~/TPansible/roles$              state: present

Command 'state:' not found, did you mean:

    command 'states' from deb enscript (1.6.5.90-3)

Try: apt install <deb name>


ansadmin@svl200:~/TPansible/roles$              name: dbapx

Command 'name:' not found, did you mean:

    command 'named' from deb bind9 (1:9.16.1-0ubuntu2.11)


    command 'namei' from deb util-linux (2.34-0.1ubuntu9.3)

Try: apt install <deb name>

ansadmin@svl200:~/TPansible/roles$          become: true


become:: command not found
ansadmin@svl200:~/TPansible/roles$          become_user: postgres
become_user:: command not found
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$      - name: Import BD
-: command not found
ansadmin@svl200:~/TPansible/roles$          become: true
become:: command not found
ansadmin@svl200:~/TPansible/roles$          become_user: postgres
become_user:: command not found
ansadmin@svl200:~/TPansible/roles$          shell: psql dbapx < /tmp/dbofi_aaw.sql
-bash: /tmp/dbofi_aaw.sql: No such file or directory
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$      - name: Add some dummy data to our database
dbapx
-: command not found
ansadmin@svl200:~/TPansible/roles$          become: true
become:: command not found
ansadmin@svl200:~/TPansible/roles$          become_user: postgres
become_user:: command not found
ansadmin@svl200:~/TPansible/roles$          shell: psql dbapx <
/home/ansadmin/dump.sql
-bash: /home/ansadmin/dump.sql: No such file or directory
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$    - name: BD
    - name: Import BD
        become: true
        become_user: postgres
        shell: psql dbapx < /tmp/dbofi_aaw.sql

    - name: Add some dummy data to our database dbapx


        become: true
        become_user: postgres
        shell: psql dbapx < /home/ansadmin/dump.sql
-: command not found
ansadmin@svl200:~/TPansible/roles$          postgresql_db:
postgresql_db:: command not found
ansadmin@svl200:~/TPansible/roles$              state: present

Command 'state:' not found, did you mean:

    command 'states' from deb enscript (1.6.5.90-3)

Try: apt install <deb name>


ansadmin@svl200:~/TPansible/roles$              name: dbapx

Command 'name:' not found, did you mean:

    command 'namei' from deb util-linux (2.34-0.1ubuntu9.3)


    command 'named' from deb bind9 (1:9.16.1-0ubuntu2.11)

Try: apt install <deb name>

ansadmin@svl200:~/TPansible/roles$          become: true


become:: command not found
ansadmin@svl200:~/TPansible/roles$          become_user: postgres
become_user:: command not found
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$      - name: Import BD
-: command not found
ansadmin@svl200:~/TPansible/roles$          become: true
become:: command not found
ansadmin@svl200:~/TPansible/roles$          become_user: postgres
become_user:: command not found
ansadmin@svl200:~/TPansible/roles$          shell: psql dbapx < /tmp/dbofi_aaw.sql
-bash: /tmp/dbofi_aaw.sql: No such file or directory
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$      - name: Add some dummy data to our database
dbapx
-: command not found
ansadmin@svl200:~/TPansible/roles$          become: true
become:: command not found
ansadmin@svl200:~/TPansible/roles$          become_user: postgres
become_user:: command not found
ansadmin@svl200:~/TPansible/roles$          shell: psql dbapx <
/home/ansadmin/dump.sql
-bash: /home/ansadmin/dump.sql: No such file or directory
ansadmin@svl200:~/TPansible/roles$ ^C
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$ ansible-galaxy init TPpostgres
- Role TPpostgres was created successfully
ansadmin@svl200:~/TPansible/roles$ cd TPpostgres/
ansadmin@svl200:~/TPansible/roles/TPpostgres$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

8 directories, 8 files
ansadmin@svl200:~/TPansible/roles/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible/roles$ tree
.
├── TPpostgres
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── postgres
│   ├── handlers
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   │   └── index.html.j2
│   └── vars
│            └── main.yml
└── users
        ├── handlers
        │   └── main.yml
        ├── tasks
        │   └── main.yml
        ├── templates
        │   └── index.html.j2
        └── vars
                └── main.yml

19 directories, 16 files
ansadmin@svl200:~/TPansible/roles$ cd ..
ansadmin@svl200:~/TPansible$ tree
.
├── dump.yml
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── main.yml
├── main_base.yml
├── main_houcem.yml
├── main_postgres.yml
├── psql.yml
├── roles
│   ├── TPpostgres
│   │   ├── README.md
│   │   ├── defaults
│   │   │   └── main.yml
│   │   ├── files
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── meta
│   │   │   └── main.yml
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   ├── tests
│   │   │   ├── inventory
│   │   │   └── test.yml
│   │   └── vars
│   │            └── main.yml
│   ├── postgres
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   │   └── index.html.j2
│   │   └── vars
│   │            └── main.yml
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

22 directories, 25 files
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ls
dump.yml        hosts_vars          main_houcem.yml        roles
group_vars    main.yml              main_postgres.yml    site.yml
hosts.yml      main_base.yml    psql.yml
ansadmin@svl200:~/TPansible$ cd roles
ansadmin@svl200:~/TPansible/roles$ ls
TPpostgres    postgres    users
ansadmin@svl200:~/TPansible/roles$ mv TPpostgres/ ../
ansadmin@svl200:~/TPansible/roles$ cd..
cd..: command not found
ansadmin@svl200:~/TPansible/roles$ cd ..
ansadmin@svl200:~/TPansible$ ls
TPpostgres    hosts.yml      main_base.yml            psql.yml
dump.yml        hosts_vars    main_houcem.yml        roles
group_vars    main.yml        main_postgres.yml    site.yml
ansadmin@svl200:~/TPansible$ tree
.
├── TPpostgres
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── dump.yml
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── main.yml
├── main_base.yml
├── main_houcem.yml
├── main_postgres.yml
├── psql.yml
├── roles
│   ├── postgres
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   │   └── index.html.j2
│   │   └── vars
│   │            └── main.yml
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

22 directories, 25 files
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ cd TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

8 directories, 8 files
ansadmin@svl200:~/TPansible/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible$ ls
TPpostgres    hosts.yml      main_base.yml            psql.yml
dump.yml        hosts_vars    main_houcem.yml        roles
group_vars    main.yml        main_postgres.yml    site.yml
ansadmin@svl200:~/TPansible$ cp main_postgres.yml ./
TPpostgres/                hosts_vars/                main_postgres.yml
dump.yml                      main.yml                      psql.yml
group_vars/                main_base.yml            roles/
hosts.yml                    main_houcem.yml        site.yml
ansadmin@svl200:~/TPansible$ cp main_postgres.yml ./TPpostgres/
.travis.yml    defaults/        handlers/        tasks/              tests/
README.md        files/              meta/                templates/      vars/
ansadmin@svl200:~/TPansible$ cp main_postgres.yml ./TPpostgres/tasks/mai             
n.yml
ansadmin@svl200:~/TPansible$ cd TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

8 directories, 8 files
ansadmin@svl200:~/TPansible/TPpostgres$ mkdir group_vars
ansadmin@svl200:~/TPansible/TPpostgres$ mkdir hosts_vars
ansadmin@svl200:~/TPansible/TPpostgres$ mkdir group_vars/all.yml
ansadmin@svl200:~/TPansible/TPpostgres$ cd
ansadmin@svl200:~$ ls
TP3                      hello.yaml                play-vars.yaml    template1.yaml
TPansible          hello.yml                  play-vars.yml      var_dic.yml
cible1.txt        index.html                projet                    var_dic2.yml
copie.yaml        index.html.j2          projet1                  var_dic_multi3.yml
debug.yaml        index.html1.j2        projet2                  vars.yml
debug1.yaml      ip.txt                        projet3                  vars2.yml
exo2.yaml          item_users.yaml      projet4                  vars_multi.yml
exo3.yaml          items.yaml                rep.yaml                when.yaml
exo4.yaml          items_users.yaml    seq.yaml                when1.yaml
fact.yaml          list.yaml                  shell.yml
fact1.yaml        locale.yml                snap
handler.yaml    nginx.yaml                template.yaml
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ls
geerlingguy.apache    group_vars    hosts.yml    hosts_vars    site.yml
ansadmin@svl200:~/projet4$ sudo vim geerlingguy.apache/
.ansible-lint    LICENSE                meta/                    templates/
.github/              README.md            molecule/            vars/
.gitignore          defaults/            site.yml
.yamllint            handlers/            tasks/
ansadmin@svl200:~/projet4$ sudo vim geerlingguy.apache/tasks/
configure-Debian.yml      configure-Suse.yml          setup-RedHat.yml
configure-RedHat.yml      main.yml                              setup-Solaris.yml
configure-Solaris.yml    setup-Debian.yml              setup-Suse.yml
ansadmin@svl200:~/projet4$ sudo vim geerlingguy.apache/tasks/main.yml
ansadmin@svl200:~/projet4$ cd
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ls
geerlingguy.apache    group_vars    hosts.yml    hosts_vars    site.yml
ansadmin@svl200:~/projet4$ tree
.
├── geerlingguy.apache
│   ├── LICENSE
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── molecule
│   │   └── default
│   │            ├── converge.yml
│   │            └── molecule.yml
│   ├── site.yml
│   ├── tasks
│   │   ├── configure-Debian.yml
│   │   ├── configure-RedHat.yml
│   │   ├── configure-Solaris.yml
│   │   ├── configure-Suse.yml
│   │   ├── main.yml
│   │   ├── setup-Debian.yml
│   │   ├── setup-RedHat.yml
│   │   ├── setup-Solaris.yml
│   │   └── setup-Suse.yml
│   ├── templates
│   │   └── vhosts.conf.j2
│   └── vars
│            ├── AmazonLinux.yml
│            ├── Debian.yml
│            ├── RedHat.yml
│            ├── Solaris.yml
│            ├── Suse.yml
│            ├── apache-22.yml
│            └── apache-24.yml
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
└── site.yml

11 directories, 28 files
ansadmin@svl200:~/projet4$ cd
ansadmin@svl200:~$ cd
.ansible/    TP3/              projet/        projet2/      projet4/
.ssh/            TPansible/ projet1/      projet3/      snap/
ansadmin@svl200:~$ cd TPansible/
TPpostgres/ group_vars/ hosts_vars/ roles/
ansadmin@svl200:~$ cd TPansible/TPpostgres/
defaults/      group_vars/ hosts_vars/ tasks/            tests/
files/            handlers/      meta/              templates/    vars/
ansadmin@svl200:~$ sudo vim TPansible/TPpostgres/vars/main.yml
ansadmin@svl200:~$ cd TP
TP3/              TPansible/
ansadmin@svl200:~$ cd TPansible/TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── group_vars
│   └── all.yml
├── handlers
│   └── main.yml
├── hosts_vars
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

11 directories, 8 files
ansadmin@svl200:~/TPansible/TPpostgres$ ls
README.md    files              handlers        meta      templates    vars
defaults      group_vars    hosts_vars    tasks    tests
ansadmin@svl200:~/TPansible/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible$ ls
TPpostgres    hosts.yml      main_base.yml            psql.yml
dump.yml        hosts_vars    main_houcem.yml        roles
group_vars    main.yml        main_postgres.yml    site.yml
ansadmin@svl200:~/TPansible$ cd group_vars/
ansadmin@svl200:~/TPansible/group_vars$ ls
all.yml
ansadmin@svl200:~/TPansible/group_vars$ cp all.yml ../TPpostgres/
.travis.yml    files/              hosts_vars/    templates/
README.md        group_vars/    meta/                tests/
defaults/        handlers/        tasks/              vars/
ansadmin@svl200:~/TPansible/group_vars$ cp all.yml ../TPpostgres/group_v             
ars/
cp: cannot overwrite directory '../TPpostgres/group_vars/all.yml' with n             
on-directory
ansadmin@svl200:~/TPansible/group_vars$ cp all.yml ../TPpostgres/group_v             
ars/all.yml
ansadmin@svl200:~/TPansible/group_vars$
ansadmin@svl200:~/TPansible/group_vars$ cd ..
ansadmin@svl200:~/TPansible$ tree
.
├── TPpostgres
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── group_vars
│   │   └── all.yml
│   │            └── all.yml
│   ├── handlers
│   │   └── main.yml
│   ├── hosts_vars
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── dump.yml
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── main.yml
├── main_base.yml
├── main_houcem.yml
├── main_postgres.yml
├── psql.yml
├── roles
│   ├── postgres
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   │   └── index.html.j2
│   │   └── vars
│   │            └── main.yml
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

25 directories, 26 files
ansadmin@svl200:~/TPansible$ cd TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ ls
README.md    files              handlers        meta      templates    vars
defaults      group_vars    hosts_vars    tasks    tests
ansadmin@svl200:~/TPansible/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible$ ls
TPpostgres    hosts.yml      main_base.yml            psql.yml
dump.yml        hosts_vars    main_houcem.yml        roles
group_vars    main.yml        main_postgres.yml    site.yml
ansadmin@svl200:~/TPansible$ sudo vim site.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ TPpostgres/
-bash: TPpostgres/: Is a directory
ansadmin@svl200:~/TPansible$ cd TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── group_vars
│   └── all.yml
│            └── all.yml
├── handlers
│   └── main.yml
├── hosts_vars
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

11 directories, 9 files
ansadmin@svl200:~/TPansible/TPpostgres$ ansible-playbook -i hosts.yml site.yml
ERROR! the playbook: site.yml could not be found
ansadmin@svl200:~/TPansible/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml
ERROR! conflicting action statements: hosts, gather_facts

The error appears to be in '/home/ansadmin/TPansible/TPpostgres/tasks/main.yml': line


1, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: install postgresql and BD


    ^ here
ansadmin@svl200:~/TPansible$ TPp
TPp: command not found
ansadmin@svl200:~/TPansible$ cd TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ ls
README.md    defaults    files    group_vars    handlers    hosts_vars    meta   
tasks    templates    tests    var
ansadmin@svl200:~/TPansible/TPpostgres$ tree
.
├── README.md
├── defaults
│   └── main.yml
├── files
├── group_vars
│   └── all.yml
│            └── all.yml
├── handlers
│   └── main.yml
├── hosts_vars
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
        └── main.yml

11 directories, 9 files
ansadmin@svl200:~/TPansible/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible$ tree
.
├── TPpostgres
│   ├── README.md
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   ├── group_vars
│   │   └── all.yml
│   │            └── all.yml
│   ├── handlers
│   │   └── main.yml
│   ├── hosts_vars
│   ├── meta
│   │   └── main.yml
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│            └── main.yml
├── dump.yml
├── group_vars
│   └── all.yml
├── hosts.yml
├── hosts_vars
├── main.yml
├── main_base.yml
├── main_houcem.yml
├── main_postgres.yml
├── psql.yml
├── roles
│   ├── postgres
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   │   └── index.html.j2
│   │   └── vars
│   │            └── main.yml
│   └── users
│            ├── handlers
│            │   └── main.yml
│            ├── tasks
│            │   └── main.yml
│            ├── templates
│            │   └── index.html.j2
│            └── vars
│                    └── main.yml
└── site.yml

25 directories, 26 files
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml
ERROR! conflicting action statements: hosts, gather_facts

The error appears to be in '/home/ansadmin/TPansible/TPpostgres/tasks/main.yml': line


1, column
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: install postgresql and BD


    ^ here
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml site.yml
    hosts: cible1
    become: yes
    become_method: sudo
    gather_facts: yes

    tasks:
    - name: installation postgresql-contrib
        apt:
            name: postgresql-contrib
            state: latest

    - name: package_python
        apt:
            name: python3-psycopg2
            state: latest

    - name: acl
        apt:
            name: acl
            state: latest

    - name: installation postgresql


        apt:
            name: postgresql
            state: present

    - name: start servicde


        service:
            name: postgresql
            state: started
            enabled: true

    - name: BD
Network error: Software caused connection abort
            state: present
─────────────────────────────────────────────────────────────────────────────────────
───────────
        become: true
Session stopped: postgres
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

10 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Thu Oct    6 12:01:07 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$ ls
TP3                  debug1.yaml    fact1.yaml        index.html.j2       
items_users.yaml    play-vars.yml    projet4
TPansible      exo2.yaml        handler.yaml    index.html1.j2      list.yaml       
projet                  rep.yam
cible1.txt    exo3.yaml        hello.yaml        ip.txt                     
locale.yml                projet1                seq.yam
copie.yaml    exo4.yaml        hello.yml          item_users.yaml    nginx.yaml     
projet2                shell.y
debug.yaml    fact.yaml        index.html        items.yaml              play-
vars.yaml        projet3                snap
ansadmin@svl200:~$ cd TPansible/
TPpostgres/ group_vars/ hosts_vars/ roles/
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ls
TPpostgres    dump.yml    group_vars    hosts.yml    hosts_vars    main.yml   
main_base.yml    main_houcem.ym
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
───────────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file
ofi03@146.59.156.114's password:
        ┌──────────────────────────────────────────────────────────────────────┐
        │                                  • MobaXterm Personal Edition v22.0 •     

        │                              (SSH client, X server and network tools)     

        │                                                                           

        │ → SSH session to ofi03@146.59.156.114                                     

        │      • Direct SSH            :    v                                       

        │      • SSH compression :    v                                             

        │      • SSH-browser          :    v                                         

        │      • X11-forwarding    :    v    (remote display is forwarded through
SSH)    │
        │                                                                           

        │ → For more info, ctrl+click on help or visit our website.                 

        └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-122-generic x86_64)

* Documentation:    https://help.ubuntu.com
* Management:          https://landscape.canonical.com
* Support:                https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory


      footprint of MicroK8s to make it the smallest full K8s around.

      https://ubuntu.com/blog/microk8s-memory-optimisation

10 updates can be applied immediately.


To see these additional updates run: apt list --upgradable

*** System restart required ***


Last login: Thu Oct    6 16:12:19 2022 from 176.160.191.208
ofi03@svl200:~$
ofi03@svl200:~$ ls -lrta .git/
ls: cannot access '.git/': No such file or directory
ofi03@svl200:~$
ofi03@svl200:~$ mkdir projetgit
ofi03@svl200:~$ cd projetgit/
ofi03@svl200:~/projetgit$ git init
Initialized empty Git repository in /home/ofi03/projetgit/.git/
ofi03@svl200:~/projetgit$ ls -lrta .git/
total 40
drwxrwxr-x 2 ofi03 ofi03 4096 Oct    7 08:47 branches
drwxrwxr-x 3 ofi03 ofi03 4096 Oct    7 08:47 ..
drwxrwxr-x 4 ofi03 ofi03 4096 Oct    7 08:47 refs
drwxrwxr-x 4 ofi03 ofi03 4096 Oct    7 08:47 objects
drwxrwxr-x 2 ofi03 ofi03 4096 Oct    7 08:47 info
drwxrwxr-x 2 ofi03 ofi03 4096 Oct    7 08:47 hooks
-rw-rw-r-- 1 ofi03 ofi03      73 Oct    7 08:47 description
-rw-rw-r-- 1 ofi03 ofi03      92 Oct    7 08:47 config
-rw-rw-r-- 1 ofi03 ofi03      23 Oct    7 08:47 HEAD
drwxrwxr-x 7 ofi03 ofi03 4096 Oct    7 08:47 .
ofi03@svl200:~/projetgit$ git config --global user.name "aaw"
ofi03@svl200:~/projetgit$ git config --global user.email ahmadoudiaaw@gmail.com
ofi03@svl200:~/projetgit$ git add fichier.html
fatal: pathspec 'fichier.html' did not match any files
ofi03@svl200:~/projetgit$ touch fichier.html
ofi03@svl200:~/projetgit$ git add fichier.html
ofi03@svl200:~/projetgit$ git commit
hint: Waiting for your editor to close the file...

Use "fg" to return to nano.

[1]+    Stopped                                  git commit


ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git commit
hint: Waiting for your editor to close the file...

Use "fg" to return to nano.

[2]+    Stopped                                  git commit


ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git add fichier.html
ofi03@svl200:~/projetgit$ git commit
hint: Waiting for your editor to close the file...

Use "fg" to return to nano.


[3]+    Stopped                                  git commit
ofi03@svl200:~/projetgit$ git status
On branch master

No commits yet

Changes to be committed:
    (use "git rm --cached <file>..." to unstage)
                new file:      fichier.html

ofi03@svl200:~/projetgit$ git ls-tree -r HEAD


fatal: Not a valid object name HEAD
ofi03@svl200:~/projetgit$ git ls-tree -r head
fatal: Not a valid object name head
ofi03@svl200:~/projetgit$ git ls -tree -r head
git: 'ls' is not a git command. See 'git --help'.

The most similar command is


                log
ofi03@svl200:~/projetgit$ git ls-tree
usage: git ls-tree [<options>] <tree-ish> [<path>...]

        -d                                        only show trees


        -r                                        recurse into subtrees
        -t                                        show trees when recursing
        -z                                        terminate entries with NUL byte
        -l, --long                        include object size
        --name-only                      list only filenames
        --name-status                  list only filenames
        --full-name                      use full path names
        --full-tree                      list entire tree; not just current directory
(implies --full-name)
        --abbrev[=<n>]                use <n> digits to display SHA-1s

ofi03@svl200:~/projetgit$ git ls -tree head


git: 'ls' is not a git command. See 'git --help'.

The most similar command is


                log
ofi03@svl200:~/projetgit$ git --help
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
                      [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
                      [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--
bare]
                      [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
                      <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)


      clone                          Clone a repository into a new directory
      init                            Create an empty Git repository or reinitialize
an existing one
work on the current change (see also: git help everyday)
      add                              Add file contents to the index
      mv                                Move or rename a file, a directory, or a
symlink
      restore                      Restore working tree files
      rm                                Remove files from the working tree and from
the index
      sparse-checkout      Initialize and modify the sparse-checkout

examine the history and state (see also: git help revisions)
      bisect                        Use binary search to find the commit that
introduced a bug
      diff                            Show changes between commits, commit and
working tree, etc
      grep                            Print lines matching a pattern
      log                              Show commit logs
      show                            Show various types of objects
      status                        Show the working tree status

grow, mark and tweak your common history


      branch                        List, create, or delete branches
      commit                        Record changes to the repository
      merge                          Join two or more development histories together
      rebase                        Reapply commits on top of another base tip
      reset                          Reset current HEAD to the specified state
      switch                        Switch branches
      tag                              Create, list, delete or verify a tag object
signed with GPG

collaborate (see also: git help workflows)


      fetch                          Download objects and refs from another
repository
      pull                            Fetch from and integrate with another
repository or a local branch
      push                            Update remote refs along with associated
objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
ofi03@svl200:~/projetgit$ git --help -r
error: unknown switch `r'
usage: git help [--all] [--guides] [--man | --web | --info] [<command>]

        -a, --all                          print all available commands


        -g, --guides                    print list of useful guides
        -c, --config                    print all configuration variable names
        -m, --man                          show man page
        -w, --web                          show manual in web browser
        -i, --info                        show info page
        -v, --verbose                  print command description

ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git mv rename fichier.html fichier1.html
fatal: destination 'fichier1.html' is not a directory
ofi03@svl200:~/projetgit$ git mv rename fichier.html
fatal: bad source, source=rename, destination=fichier.html
ofi03@svl200:~/projetgit$ git ls-tree -r HEAD
fatal: Not a valid object name HEAD
ofi03@svl200:~/projetgit$ ll
total 12
drwxrwxr-x    3 ofi03 ofi03 4096 Oct    7 08:50 ./
drwxr-xr-x 23 ofi03 ofi03 4096 Oct    7 08:48 ../
drwxrwxr-x    7 ofi03 ofi03 4096 Oct    7 08:56 .git/
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 08:50 fichier.html
ofi03@svl200:~/projetgit$ git status
On branch master

No commits yet

Changes to be committed:
    (use "git rm --cached <file>..." to unstage)
                new file:      fichier.html

ofi03@svl200:~/projetgit$ git commit -m "aaw"


[master (root-commit) 38d2f37] aaw
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 fichier.html
ofi03@svl200:~/projetgit$ git ls-tree -r HEAD
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391        fichier.html
ofi03@svl200:~/projetgit$ sudo vim .gitignore
[sudo] password for ofi03:
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ ll
total 12
drwxrwxr-x    3 ofi03 ofi03 4096 Oct    7 09:05 ./
drwxr-xr-x 23 ofi03 ofi03 4096 Oct    7 08:48 ../
drwxrwxr-x    8 ofi03 ofi03 4096 Oct    7 08:58 .git/
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 08:50 fichier.html
ofi03@svl200:~/projetgit$ git add index.html
fatal: pathspec 'index.html' did not match any files
ofi03@svl200:~/projetgit$ touch index.html
ofi03@svl200:~/projetgit$ git add index.html
ofi03@svl200:~/projetgit$ touch readme.md
ofi03@svl200:~/projetgit$ git add readme.md
ofi03@svl200:~/projetgit$ git status
On branch master
Changes to be committed:
    (use "git restore --staged <file>..." to unstage)
                new file:      index.html
                new file:      readme.md

ofi03@svl200:~/projetgit$ touch tuto.pdf


ofi03@svl200:~/projetgit$ git add tuto.pdf
ofi03@svl200:~/projetgit$ sudo vim .gitignore
ofi03@svl200:~/projetgit$ git status
On branch master
Changes to be committed:
    (use "git restore --staged <file>..." to unstage)
                new file:      index.html
                new file:      readme.md
                new file:      tuto.pdf

Untracked files:
    (use "git add <file>..." to include in what will be committed)
                .gitignore

ofi03@svl200:~/projetgit$ ll
total 16
drwxrwxr-x    3 ofi03 ofi03 4096 Oct    7 09:08 ./
drwxr-xr-x 23 ofi03 ofi03 4096 Oct    7 08:48 ../
drwxrwxr-x    8 ofi03 ofi03 4096 Oct    7 09:08 .git/
-rw-r--r--    1 root    root        17 Oct    7 09:08 .gitignore
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 08:50 fichier.html
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 09:06 index.html
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 09:06 readme.md
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 09:07 tuto.pdf
ofi03@svl200:~/projetgit$ git add .gitignore
ofi03@svl200:~/projetgit$ git status
On branch master
Changes to be committed:
    (use "git restore --staged <file>..." to unstage)
                new file:      .gitignore
                new file:      index.html
                new file:      readme.md
                new file:      tuto.pdf

ofi03@svl200:~/projetgit$ git commit -m "ajout .gitignore"


[master 73cde3e] ajout .gitignore
4 files changed, 3 insertions(+)
create mode 100644 .gitignore
create mode 100644 index.html
create mode 100644 readme.md
create mode 100644 tuto.pdf
ofi03@svl200:~/projetgit$ git status
On branch master
nothing to commit, working tree clean
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git log
commit 73cde3eb6d731ca5c67f032bdc18190b4b78ef35 (HEAD -> master)
Author: aaw <ahmadoudiaaw@gmail.com>
Date:      Fri Oct 7 09:12:35 2022 +0000

        ajout .gitignore

commit 38d2f37b1b0470a41d74e1d9679dd2d7a4694a7a
Author: aaw <ahmadoudiaaw@gmail.com>
Date:      Fri Oct 7 08:58:37 2022 +0000

        aaw
ofi03@svl200:~/projetgit$ git log -1 --stat
commit 73cde3eb6d731ca5c67f032bdc18190b4b78ef35 (HEAD -> master)
Author: aaw <ahmadoudiaaw@gmail.com>
Date:      Fri Oct 7 09:12:35 2022 +0000
        ajout .gitignore

.gitignore | 3 +++
index.html | 0
readme.md    | 0
tuto.pdf      | 0
4 files changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git log -1 --oneline
73cde3e (HEAD -> master) ajout .gitignore
ofi03@svl200:~/projetgit$ git log -2 index.html
commit 73cde3eb6d731ca5c67f032bdc18190b4b78ef35 (HEAD -> master)
Author: aaw <ahmadoudiaaw@gmail.com>
Date:      Fri Oct 7 09:12:35 2022 +0000

        ajout .gitignore
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git diff
diff --git a/index.html b/index.html
index e69de29..a9a9b37 100644
--- a/index.html
+++ b/index.html
@@ -0,0 +1,3 @@
+<html> aaw </html>
+<html> aaw am </html>
+
ofi03@svl200:~/projetgit$ git add index.html
ofi03@svl200:~/projetgit$ git status
On branch master
Changes to be committed:
    (use "git restore --staged <file>..." to unstage)
                modified:      index.html

ofi03@svl200:~/projetgit$ vim index.html


ofi03@svl200:~/projetgit$ git diff --staged
diff --git a/index.html b/index.html
index e69de29..a9a9b37 100644
--- a/index.html
+++ b/index.html
@@ -0,0 +1,3 @@
+<html> aaw </html>
+<html> aaw am </html>
+
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git commit -m "modif index"
[master 19a2a9b] modif index
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git diff --staged
ofi03@svl200:~/projetgit$ git diff --cached
ofi03@svl200:~/projetgit$ git status
On branch master
nothing to commit, working tree clean
ofi03@svl200:~/projetgit$ git diff --color-words
ofi03@svl200:~/projetgit$ git status
On branch master
nothing to commit, working tree clean
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git diff --color-words=.
diff --git a/index.html b/index.html
index a9a9b37..7fd126b 100644
--- a/index.html
+++ b/index.html
@@ -1,3 +1,3 @@
<html> aaw </html>
<html> aaw amw </html>

ofi03@svl200:~/projetgit$ git diff --word-diff


diff --git a/index.html b/index.html
index a9a9b37..7fd126b 100644
--- a/index.html
+++ b/index.html
@@ -1,3 +1,3 @@
<html> aaw </html>
<html> aaw [-am-]{+aw+} </html>

ofi03@svl200:~/projetgit$ git reflog


19a2a9b (HEAD -> master) HEAD@{0}: commit: modif index
73cde3e HEAD@{1}: commit: ajout .gitignore
38d2f37 HEAD@{2}: commit (initial): aaw
ofi03@svl200:~/projetgit$ git checkout 38d2f37
error: Your local changes to the following files would be overwritten by checkout:
                index.html
Please commit your changes or stash them before you switch branches.
Aborting
ofi03@svl200:~/projetgit$ git checkout <38d2f37>
-bash: syntax error near unexpected token `newline'
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git log --oneline
19a2a9b (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ git checkout 38d2f37 index.html
error: pathspec 'index.html' did not match any file(s) known to git
ofi03@svl200:~/projetgit$ ll
total 20
drwxrwxr-x    3 ofi03 ofi03 4096 Oct    7 09:46 ./
drwxr-xr-x 23 ofi03 ofi03 4096 Oct    7 09:46 ../
drwxrwxr-x    8 ofi03 ofi03 4096 Oct    7 10:04 .git/
-rw-r--r--    1 root    root        17 Oct    7 09:08 .gitignore
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 08:50 fichier.html
-rw-rw-r--    1 ofi03 ofi03      42 Oct    7 09:46 index.html
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 09:06 readme.md
-rw-rw-r--    1 ofi03 ofi03        0 Oct    7 09:07 tuto.pdf
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git log --oneline
19a2a9b (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ git checkout 38d2f37 index.html
error: pathspec 'index.html' did not match any file(s) known to git
ofi03@svl200:~/projetgit$ git diff --word-diff
diff --git a/index.html b/index.html
index a9a9b37..7fd126b 100644
--- a/index.html
+++ b/index.html
@@ -1,3 +1,3 @@
<html> aaw </html>
<html> aaw [-am-]{+aw+} </html>

ofi03@svl200:~/projetgit$ git checkout 100644 index.html


error: pathspec '100644' did not match any file(s) known to git
ofi03@svl200:~/projetgit$ git checkout index.html 100644
error: pathspec '100644' did not match any file(s) known to git
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ git checkout 100644 index.html
error: pathspec '100644' did not match any file(s) known to git
ofi03@svl200:~/projetgit$ git diff --word-diff
diff --git a/index.html b/index.html
index a9a9b37..7fd126b 100644
--- a/index.html
+++ b/index.html
@@ -1,3 +1,3 @@
<html> aaw </html>
<html> aaw [-am-]{+aw+} </html>

ofi03@svl200:~/projetgit$ git log --oneline


19a2a9b (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ git checkout 19a2a9b index.html
Updated 1 path from f427aa8
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git checkout 19a2a9b index.html
Updated 1 path from f427aa8
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git commit --amend
hint: Waiting for your editor to close the file...

Use "fg" to return to nano.

[4]+    Stopped                                  git commit --amend


ofi03@svl200:~/projetgit$ git log --oneline
19a2a9b (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ git commit --amend --no-edit
[master de0c025] modif index
Date: Fri Oct 7 09:44:00 2022 +0000
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git log --oneline
de0c025 (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ git log --oneline
ofi03@svl200:~/projetgit$ git log --oneline
de0c025 (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git commit --amend --no-edit
[master 1ecde7e] modif index
Date: Fri Oct 7 09:44:00 2022 +0000
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git log --oneline
1ecde7e (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git commit --amend
[master fb7032a] modif index
Date: Fri Oct 7 09:44:00 2022 +0000
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git log --oneline
fb7032a (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ vim index.html
ofi03@svl200:~/projetgit$ git commit --amend
[master 9fcc5d2] modif index
Date: Fri Oct 7 09:44:00 2022 +0000
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git log --oneline
9fcc5d2 (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$ git commit --amend
[master 84cb809] modif index
Date: Fri Oct 7 09:44:00 2022 +0000
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git commit --amend
[master ec25a48] modif index
Date: Fri Oct 7 09:44:00 2022 +0000
1 file changed, 3 insertions(+)
ofi03@svl200:~/projetgit$ git log --oneline
ec25a48 (HEAD -> master) modif index
73cde3e ajout .gitignore
38d2f37 aaw
ofi03@svl200:~/projetgit$
ofi03@svl200:~/projetgit$
Network error: Software caused connection abort

─────────────────────────────────────────────────────────────────────────────────────
───────────

Session stopped
        - Press <return> to exit tab
        - Press R to restart session
        - Press S to save terminal output to file

You might also like