Mobaxterm Personal Edition V22.0 - : (SSH Client, X Server and Network Tools)
Mobaxterm Personal Edition V22.0 - : (SSH Client, X Server and Network Tools)
114's password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
https://ubuntu.com/blog/microk8s-memory-optimisation
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 RECAP
***************************************************************************
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
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
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
tasks:
- name: echo text
shell: echo "{{var1}} is var1, but var2 is {{var2}} >
/home/ansadmin/{{ansible_os_family}}.txt
ansadmin@svl200:~$ sudo vim fact.yaml
ansadmin@svl200:~$ ansible-playbook fact.yaml
PLAY [facts]
*************************************************************************************
****
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
PLAY [facts]
*************************************************************************************
****
TASK [Gathering Facts]
*******************************************************************************
ok: [146.59.158.16]
ok: [141.95.160.133]
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
PLAY [facts]
*************************************************************************************
****
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
PLAY [facts]
*************************************************************************************
****
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
tasks:
- name: echo test
command: echo -e "{{var1}} is var1 it works"
register: results
-name: debug
hosts: cible1
^ here
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ ansible-playbook debug.yaml
PLAY [debug]
**********************************************************************************
PLAY RECAP
************************************************************************************
146.59.158.16 : ok=3 changed=1 unreachable=0
failed=0 skipped=0 res
cued=0 ignored=0
PLAY [debug]
**********************************************************************************
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]
**********************************************************************************
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 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
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 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 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
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
─────────────────────────────────────────────────────────────────────────────────────
──────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
PLAY [debug]
**********************************************************************************
PLAY RECAP
************************************************************************************
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 res
cued=0 ignored=0
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 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
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 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 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
─────────────────────────────────────────────────────────────────────────────────────
──────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
tasks:
- name: utilisateur
^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! unexpected parameter type in action: <class 'int'>
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'>
---
- name: creation d'utilisateur
^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
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
tasks:
- name: deploiement
─────────────────────────────────────────────────────────────────────────────────────
──────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
tasks:
- name: deploiement
^ here
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml
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
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
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
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
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
─────────────────────────────────────────────────────────────────────────────────────
──
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
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
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 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 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 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 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
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 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 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 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 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
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
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
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
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 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 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
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]
**********************************************************
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
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]
**********************************************************
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 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
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
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
tasks:
- name: creer user
^ here
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src
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
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
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'>
---
- 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
PLAY RECAP
*************************************************************************************
**********
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 i
gnored=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 i
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 directory: '/home
/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 RECAP
*************************************************************************************
*************
141.95.160.133 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 igno
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 RECAP
*************************************************************************************
*************
141.95.160.133 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 igno
red=0
PLAY RECAP
*************************************************************************************
*************
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook play-vars.yml --ask-vault-pass
Vault password:
PLAY RECAP
*************************************************************************************
*************
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
PLAY RECAP
*************************************************************************************
*************
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
PLAY RECAP
*************************************************************************************
*************
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
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.
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ ansible-playbook locale.yml
PLAY RECAP
*************************************************************************************
*************
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 igno
red=0
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ ansible-playbook var_dic.yml
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.
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
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
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.
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.
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.
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.
name: mariadb
rpm: mariadb-server
^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
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
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 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
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
rpm: httpd
db:
^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
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 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
---
- name: variable locale de type dictionnaire
^ here
ansadmin@svl200:~$ sudo vim var_dic2.yml
ansadmin@svl200:~$ ansible-playbook var_dic2.yml
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 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"
─────────────────────────────────────────────────────────────────────────────────────
───────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'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
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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
https://ubuntu.com/blog/microk8s-memory-optimisation
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
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
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
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
ERROR! Syntax Error while loading YAML.
found unacceptable key (unhashable type: 'AnsibleMapping')
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$ sudo vim var_dic_multi3.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi3.yml
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
tasks:
- name: variable dictionnaire MultiDim
user:
name: "{{item.key}}"
group: "{{item.value.group}}"
state: "{{item.value.state}}"
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
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 RECAP
***************************************************************************
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
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
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
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]
*******************************************************************************
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
PLAY [facts]
*******************************************************************************
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
PLAY [facts]
*******************************************************************************
PLAY [facts]
*******************************************************************************
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
-name: debug
hosts: cible1
^ here
ansadmin@svl200:~$ sudo vim debug.yaml
ansadmin@svl200:~$ ansible-playbook debug.yaml
PLAY [debug]
*******************************************************************************
PLAY RECAP
*********************************************************************************
146.59.158.16 : ok=3 changed=1 unreachable=0
failed=0 skipped=0
cued=0 ignored=0
PLAY [debug]
*******************************************************************************
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]
*******************************************************************************
PLAY RECAP
*********************************************************************************
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0
cued=0 ignored=0
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 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
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 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 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
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
─────────────────────────────────────────────────────────────────────────────────────
───────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
PLAY [debug]
*******************************************************************************
PLAY RECAP
*********************************************************************************
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0
cued=0 ignored=0
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 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
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 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 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
─────────────────────────────────────────────────────────────────────────────────────
───────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
tasks:
- name: utilisateur
^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
ERROR! unexpected parameter type in action: <class 'int'>
---
- name: creation d'utilisateur
^ here
ansadmin@svl200:~$ sudo vim exo3.yaml
ansadmin@svl200:~$ ansible-playbook exo3.yaml
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
tasks:
- name: deploiement
─────────────────────────────────────────────────────────────────────────────────────
───────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
tasks:
- name: deploiement
^ here
ansadmin@svl200:~$ sudo vim exo4.yaml
ansadmin@svl200:~$ ansible-playbook exo4.yaml
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
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
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
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
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
─────────────────────────────────────────────────────────────────────────────────────
──
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
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
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 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 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 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 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 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 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 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 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
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
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
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
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 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 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
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 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 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 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
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.
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
tasks:
- name: creer user
^ here
ansadmin@svl200:~$ sudo vim template1.yaml
ansadmin@svl200:~$ ansible-playbook template1.yaml
ERROR! conflicting action statements: template, src
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
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.
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'>
---
- 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
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
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 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 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
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 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
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
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.
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim locale.yml
ansadmin@svl200:~$ ansible-playbook locale.yml
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
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic.yml
ansadmin@svl200:~$ ansible-playbook var_dic.yml
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.
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
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
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.
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.
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.
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.
name: mariadb
rpm: mariadb-server
^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
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
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 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
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
rpm: httpd
db:
^ here
ansadmin@svl200:~$ sudo vim var_dic1.yml
ansadmin@svl200:~$ ansible-playbook var_dic1.yml
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
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}}"
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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}}"
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* 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 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 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
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
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_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
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 }}
with_items:
- "{{ foo }}"
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
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_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
ERROR! Syntax Error while loading YAML.
did not find expected key
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:
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
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
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
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_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, found a
duplicate dict key (apt). Using last defined value only.
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_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
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
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:~$ q
ansadmin@svl200:~$
ansadmin@svl200:~$ sudo vim var_dic_multi4.yml
ansadmin@svl200:~$ ansible-playbook var_dic_multi4.yml
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
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_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, found a
duplicate dict key (apt). Using last defined value only.
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
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
PLAY RECAP
*************************************************************************************
*****************
141.95.160.133 : ok=1 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 ignored=
0
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 ignored=
0
PLAY RECAP
*************************************************************************************
*****************
141.95.160.133 : ok=1 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 ignored=
0
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 ignored=
0
PLAY RECAP
*************************************************************************************
*****************
141.95.160.133 : ok=1 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 ignored=
0
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 ignored=
0
PLAY RECAP
*************************************************************************************
*****************
141.95.160.133 : ok=1 changed=0 unreachable=0
failed=0 skipped=2 rescued=0 ignored=
0
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=0 skipped=2 rescued=0 ignored=
0
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
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 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 'int'>
PLAY RECAP
*************************************************************************************
*****************
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
PLAY RECAP
*************************************************************************************
*****************
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
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
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 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 "type=web"
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 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:~/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-vars "type=web"
ERROR! 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 RECAP
*************************************************************************************
*************
141.95.160.133 : ok=0 changed=0 unreachable=1
failed=0 skipped=0 rescued=0 igno
red=0
146.59.158.16 : ok=0 changed=0 unreachable=1
failed=0 skipped=0 rescued=0 igno
red=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 RECAP
*************************************************************************************
*************
141.95.160.133 : ok=2 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 igno
red=0
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=1 rescued=0 igno
red=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
with_items:
- {{ foo }}
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
# ("{{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
# ("{{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
# ("{{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
# ("{{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
# ("{{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
---
- 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
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.yml
.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
PLAY RECAP
*************************************************************************************
*************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 igno
red=0
client2 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 igno
red=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 RECAP
*************************************************************************************
*************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 igno
red=0
client2 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 igno
red=0
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.
debug:
^ here
ansadmin@svl200:~/projet$ sudo vim install.yaml
ansadmin@svl200:~/projet$ ansible-playbook -i inventory.yaml install.yaml --extra-
vars "type=web"
PLAY RECAP
*************************************************************************************
*************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 igno
red=0
client2 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 igno
red=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 localhost does not match 'all'
PLAY RECAP
*************************************************************************************
************************************
PLAY RECAP
*************************************************************************************
************************************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
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
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 RECAP
*************************************************************************************
************************************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
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 RECAP
*************************************************************************************
************************************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
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 RECAP
*************************************************************************************
************************************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
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: Connection refused",
"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 RECAP
*************************************************************************************
************************************
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
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: Connection refused",
"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
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 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 vars2.yml
copie.yaml fact.yaml index.html.j2 list.yaml
projet1 template1.yaml vars_multi.yml
debug.yaml fact1.yaml index.html1.j2 locale.yml
rep.yaml var_dic.yml when.yaml
debug1.yaml handler.yaml ip.txt nginx.yaml
seq.yaml var_dic2.yml when1.yaml
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 vars2.yml
copie.yaml fact.yaml index.html.j2 list.yaml
projet1 template1.yaml vars_multi.yml
debug.yaml fact1.yaml index.html1.j2 locale.yml
rep.yaml var_dic.yml when.yaml
debug1.yaml handler.yaml ip.txt nginx.yaml
seq.yaml var_dic2.yml when1.yaml
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 RECAP
*************************************************************************************
*************
client1 : ok=3 changed=0
unreachable=0 failed=0 skipped=0 rescued=0 igno
red=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 vars.yml
copie.yaml fact.yaml index.html.j2 list.yaml
projet1 template1.yaml vars2.yml
debug.yaml fact1.yaml index.html1.j2 locale.yml
rep.yaml users vars_multi.yml
debug1.yaml handler.yaml ip.txt nginx.yaml
seq.yaml var_dic.yml when.yaml
exo2.yaml hello.yaml item_users.yaml play-vars.yaml shell.yml
var_dic2.yml when1.yaml
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 vars.yml
copie.yaml fact.yaml index.html.j2 list.yaml
projet1 template.yaml vars2.yml
debug.yaml fact1.yaml index.html1.j2 locale.yml
projet2 template1.yaml vars_multi.yml
debug1.yaml handler.yaml ip.txt nginx.yaml
rep.yaml var_dic.yml when.yaml
exo2.yaml hello.yaml item_users.yaml play-vars.yaml seq.yaml
var_dic2.yml when1.yaml
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/roles:/usr/sha
re/ansible/roles:/etc/ansible/roles:/home/ansadmin/projet2
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
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
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
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_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 FORKS]
[-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_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 FORKS]
[-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, found a
duplicate dict key (cible1). Using last defined value only.
ERROR! Syntax Error while loading YAML.
mapping values are not allowed in this context
PLAY RECAP
*************************************************************************************
*************
client2 : ok=3 changed=2
unreachable=0 failed=1 skipped=0 rescued=0 igno
red=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, found a
duplicate dict key (cible1). Using last defined value only.
PLAY RECAP
*************************************************************************************
*************
client2 : ok=3 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 igno
red=0
PLAY RECAP
*************************************************************************************
*************
client2 : ok=3 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 igno
red=0
PLAY RECAP
*************************************************************************************
*************
client2 : ok=3 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 igno
red=0
PLAY RECAP
*************************************************************************************
*************
client2 : ok=3 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 igno
red=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, found a
duplicate dict key (cible1). Using last defined value only.
PLAY RECAP
*************************************************************************************
*************
client2 : ok=5 changed=2
unreachable=0 failed=0 skipped=1 rescued=0 igno
red=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 FORKS]
[-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
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.
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.
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.
TASK [geerlingguy.apache : Ensure Apache has selected state and enabled on boot.
] ***
ok: [client2]
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
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
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
[email protected]
-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
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
[email protected]: 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 RECAP
*****************************************************************************
141.95.160.128 : ok=0 changed=0 unreachable=1
failed=0 skipped=0
rescued=0 ignored=0
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 RECAP
*****************************************************************************
146.59.158.16 : ok=0 changed=0 unreachable=1
failed=0 skipped=0
rescued=0 ignored=0
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 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
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
[email protected]
.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
[email protected]
.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
[email protected]'s password:
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$
ansadmin@svl200:~/TP3$ ansible-playbook exo1.yaml
PLAY [creation de partition]
***********************************************************
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 [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
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
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
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
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
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
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
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
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
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
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
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
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$ 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 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$
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 | 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
TASK [partition]
*************************************************************************************
******************************************************************
fatal: [146.59.158.16]: FAILED! => {"changed": false, "err": "Error: Could not stat
device /dev/aaw - No such file or directory.\n", "msg": "Error while getting device
information 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
TASK [partition]
*************************************************************************************
******************************************************************
[WARNING]: The value 250 (type int) in a string field was converted to '250' (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, "err": [250.0, ""], "msg": "The
argument 'part_end' doesn't respect required format.The size unit is case sensitiv
e."}
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$
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 7, found a duplicate dict key
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks
---
- 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 7, found a duplicate dict key
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks
---
- 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 7, found a duplicate dict key
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks
---
- 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 7, found a duplicate dict key
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks
---
- 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 7, found a duplicate dict key
(cible1). Using last defined value only.
ERROR! conflicting action statements: hosts, tasks
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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 in group names by default, this
will change, but still be user configurable on deprecation. This feature will be
removed in version 2.10. Deprecation warnings can
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 details
ERROR! conflicting action statements: hosts, tasks
---
- 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 in group names by default, this
will change, but still be user configurable on deprecation. This feature will be
removed in version 2.10. Deprecation warnings can
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 details
ERROR! conflicting action statements: hosts, tasks
---
- 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/ snap/
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 in group names by default, this
will change, but still be user configurable on deprecation. This feature will be
removed in version 2.10. Deprecation warnings can
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 details
ERROR! conflicting action statements: hosts, tasks
---
- 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
---
- 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 RECAP
*************************************************************************************
************************************
141.95.160.128 : ok=0 changed=0 unreachable=1
failed=0 skipped=0 rescued=0 ignored=0
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
client2 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ssh-copy-id -i /home/ansadmin/.ssh/id_rsa.pub
[email protected] -p 55600
/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 already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted
now it is to install the new keys
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Now try logging into the machine, with: "ssh -p '55600' '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
---
- 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 RECAP
*************************************************************************************
************************************
141.95.160.128 : ok=0 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
client1 : ok=0 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
client2 : ok=0 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
TASK [partition1]
*************************************************************************************
*****************************
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 rescued=0 ignored=0
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
client2 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
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
TASK [partition1]
*************************************************************************************
*****************************
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=1 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
client1 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
client2 : ok=0 changed=0
unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
TASK [partition1]
*************************************************************************************
*****************************
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 rescued=0 ignored=0
TASK [partition1]
*************************************************************************************
*****************************
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 rescued=0 ignored=0
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: 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: 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
TASK [partition1]
*************************************************************************************
*****************************
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 rescued=0 ignored=0
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: [email protected]:
Permission denied (publickey,password).",
"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 template1.yaml vars_multi.yml
TPansible exo3.yaml hello.yml items.yaml
play-vars.yml rep.yaml var_dic.yml when.yaml
cible1.txt exo4.yaml index.html items_users.yaml projet
seq.yaml var_dic2.yml when1.yaml
copie.yaml fact.yaml index.html.j2 list.yaml
projet1 shell.yml var_dic_multi3.yml
debug.yaml fact1.yaml index.html1.j2 locale.yml projet2
snap vars.yml
debug1.yaml handler.yaml ip.txt nginx.yaml
projet3 template.yaml vars2.yml
ansadmin@svl200:~$
lv: ansible_lv1_aaw
size: 250M
force: yes
- 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
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
TASK [partition1]
*************************************************************************************
*****************************
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 rescued=0 ignored=0
TASK [partition1]
*************************************************************************************
*****************************
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 rescued=0 ignored=0
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
TASK [partition1]
*************************************************************************************
*****************************
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 [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 rescued=0 ignored=0
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: 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: 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 RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=0 changed=0 unreachable=1
failed=0 skipped=0 rescued=0 ignored=0
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 [debug]
*************************************************************************************
**********************************
ok: [146.59.158.16] => {
"msg": "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main"
}
PLAY RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=7 changed=3 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
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 RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=2 changed=0 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=1 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*************************
changed: [146.59.158.16]
TASK [acl]
*************************************************************************************
************************************
changed: [146.59.158.16]
PLAY RECAP
*************************************************************************************
************************************
146.59.158.16 : ok=4 changed=3 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*************************
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
************************************
ok: [146.59.158.16]
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
changed: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=2 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
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
with_items:
- {{ foo }}
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.AnsibleMapping'> instead
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]
*********************************************************************************
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=4 changed=2 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=4 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/TPansible$ sudo vim psql.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml psql.yml
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=4 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=4 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=4 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
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=1 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=9 changed=2 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [sauvegarde]
*************************************************************************************
***********
fatal: [146.59.158.16]: FAILED! => {"changed": false, "cmd": "/usr/bin/pg_dump dbofi
--port=5432 --username=postgr
es > /tmp/dbofi.sql", "msg": "pg_dump: error: connection to server on socket
\"/var/run/postgresql/.s.PGSQL.5432\"
failed: FATAL: Peer authentication failed for user \"postgres\"\n", "rc": 1,
"stdout": "", "stdout_lines": []}
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=9 changed=2 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
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
- 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: include_tasks, script,
set_fact, raw, shell, include, add_host, import_role, win_command, meta,
include_vars, command, include_role, imp
ort_tasks, win_shell, group_by
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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=9 changed=2 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
TASK [sauvegarde]
*************************************************************************************
***********
fatal: [146.59.158.16]: FAILED! => {"changed": false, "cmd": "/usr/bin/pg_dump dbofi
--port=5432 --username=postgr
es > /tmp/dbofi.sql", "msg": "pg_dump: error: connection to server on socket
\"/var/run/postgresql/.s.PGSQL.5432\"
failed: FATAL: Peer authentication failed for user \"postgres\"\n", "rc": 1,
"stdout": "", "stdout_lines": []}
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=9 changed=2 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ sudo vim main_postgres.yml
ansadmin@svl200:~/TPansible$ ansible-playbook -i hosts.yml main_postgres.yml
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [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 rescued=0 ignored=0
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: BD
postgresql_db:
state: present
name: dbofi
become: true
become_user: postgres
- 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
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
TASK [sauvegarde]
*************************************************************************************
***********
changed: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
changed: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=12 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
TASK [sauvegarde]
*************************************************************************************
***********
changed: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=12 changed=4 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
TASK [package_python]
*************************************************************************************
*******
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
******************
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
TASK [sauvegarde]
*************************************************************************************
***********
changed: [146.59.158.16]
TASK [BD]
*************************************************************************************
*******************
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
******************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
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
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
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
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: 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
34,1 Top
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
10 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
─────────────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: fichier.html
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
'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>]
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
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
ajout .gitignore
commit 38d2f37b1b0470a41d74e1d9679dd2d7a4694a7a
Author: aaw <[email protected]>
Date: Fri Oct 7 08:58:37 2022 +0000
aaw
ofi03@svl200:~/projetgit$ git log -1 --stat
commit 73cde3eb6d731ca5c67f032bdc18190b4b78ef35 (HEAD -> master)
Author: aaw <[email protected]>
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 <[email protected]>
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
─────────────────────────────────────────────────────────────────────────────────────
───────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
https://ubuntu.com/blog/microk8s-memory-optimisation
─────────────────────────────────────────────────────────────────────────────────────
───────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.txt
nothing added to commit but untracked files present (use "git add" to track)
ansadmin@svl200:~/git/projet1$ git add test.txt
ansadmin@svl200:~/git/projet1$ git commit -m "ajout new file"
─────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────
───────────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
Access denied
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* 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
https://ubuntu.com/blog/microk8s-memory-optimisation
Run
─────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────
───────────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
─────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────
───────────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
4 directories, 4 files
ansadmin@svl200:~/TPansible/roles/postgres$ sudo vim handlers/main.yml
ansadmin@svl200:~/TPansible/roles/postgres$ cd ..
ansadmin@svl200:~/TPansible/roles$ ll
total 16
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 6 15:06 ./
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 18:05 ../
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 14:57 postgres/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 09:40 users/
ansadmin@svl200:~/TPansible/roles$ cd ..
ansadmin@svl200:~/TPansible$ LL
LL: command not found
ansadmin@svl200:~/TPansible$ ll
total 52
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 18:05 ./
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 12:36 ../
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 6 15:10 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 6 15:06 roles/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ mv -r TPpostgres/ roles/
mv: invalid option -- 'r'
Try 'mv --help' for more information.
ansadmin@svl200:~/TPansible$ mv TPpostgres/ roles/
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ ll
total 48
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:43 ./
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 12:36 ../
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:43 roles/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ cd roles
ansadmin@svl200:~/TPansible/roles$ ll
total 20
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:43 ./
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:43 ../
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 6 15:10 TPpostgres/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 14:57 postgres/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 09:40 users/
ansadmin@svl200:~/TPansible/roles$ mv TPpostgres/ ../
ansadmin@svl200:~/TPansible/roles$ ll
total 16
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 ./
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:44 ../
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 14:57 postgres/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 09:40 users/
ansadmin@svl200:~/TPansible/roles$ cd ..
ansadmin@svl200:~/TPansible$ ll
total 52
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:44 ./
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 12:36 ../
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 6 15:10 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ mv roles/ TPpostgres/
ansadmin@svl200:~/TPansible$ cd TPpostgres/
ansadmin@svl200:~/TPansible/TPpostgres$ ll
total 60
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:45 ./
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:45 ../
-rw-rw-r-- 1 ansadmin ansadmin 539 Oct 6 15:04 .travis.yml
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/TPansible/TPpostgres$ cd roles/
ansadmin@svl200:~/TPansible/TPpostgres/roles$ ll
total 16
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 ./
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:45 ../
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 14:57 postgres/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 6 09:40 users/
ansadmin@svl200:~/TPansible/TPpostgres/roles$ cd ..
ansadmin@svl200:~/TPansible/TPpostgres$ mv roles roles1
ansadmin@svl200:~/TPansible/TPpostgres$ ll
total 60
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:48 ./
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:45 ../
-rw-rw-r-- 1 ansadmin ansadmin 539 Oct 6 15:04 .travis.yml
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/TPansible/TPpostgres$ mkdir roles
ansadmin@svl200:~/TPansible/TPpostgres$ ll
total 64
drwxrwxr-x 14 ansadmin ansadmin 4096 Oct 7 18:48 ./
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 18:45 ../
-rw-rw-r-- 1 ansadmin ansadmin 539 Oct 6 15:04 .travis.yml
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:48 roles/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/TPansible/TPpostgres$ vim README.md
ansadmin@svl200:~/TPansible/TPpostgres$ mv * roles
roles/ roles1/
ansadmin@svl200:~/TPansible/TPpostgres$ mv * roles
mv: cannot move 'roles' to a subdirectory of itself, 'roles/roles'
ansadmin@svl200:~/TPansible/TPpostgres$ mv roles/ ../
ansadmin@svl200:~/TPansible/TPpostgres$ ll
total 12
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:51 ./
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:51 ../
-rw-rw-r-- 1 ansadmin ansadmin 539 Oct 6 15:04 .travis.yml
ansadmin@svl200:~/TPansible/TPpostgres$ cd ..
ansadmin@svl200:~/TPansible$ ll
total 52
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:51 ./
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:51 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 roles/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ cd roles/
ansadmin@svl200:~/TPansible/roles$ ll
total 56
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 ./
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:51 ../
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$ cd ..
ansadmin@svl200:~/TPansible$ ll
total 52
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:51 ./
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:51 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 roles/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ cd roles/
ansadmin@svl200:~/TPansible/roles$ ll
total 56
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 ./
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:51 ../
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/TPansible/roles$ mv roles1/ ../
ansadmin@svl200:~/TPansible/roles$
ansadmin@svl200:~/TPansible/roles$ ll
total 52
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 ./
drwxrwxr-x 7 ansadmin ansadmin 4096 Oct 7 18:53 ../
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/TPansible/roles$ cd ..
ansadmin@svl200:~/TPansible$ tree
.
├── TPpostgres
├── dump.yml
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── main.yml
├── main_base.yml
├── main_houcem.yml
├── main_postgres.yml
├── psql.yml
├── roles
│ ├── 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
├── roles1
│ ├── 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
26 directories, 26 files
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ cd
ansadmin@svl200:~$ ll
total 272
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 ./
drwxr-xr-x 11 root root 4096 Oct 3 08:32 ../
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 14:52 .ansible/
-rw------- 1 ansadmin ansadmin 31795 Oct 7 13:03 .bash_history
-rw-r--r-- 1 ansadmin ansadmin 220 Oct 3 08:32 .bash_logout
-rw-r--r-- 1 ansadmin ansadmin 3771 Oct 3 08:32 .bashrc
-rw-r--r-- 1 root root 12288 Oct 4 08:51 .exo4.yaml.swp
-rw------- 1 root root 12288 Oct 3 13:11 .handler.yaml.swp
-rw-r--r-- 1 ansadmin ansadmin 807 Oct 3 08:32 .profile
drwx------ 2 ansadmin ansadmin 4096 Oct 6 10:47 .ssh/
-rw------- 1 ansadmin ansadmin 8842 Oct 7 18:49 .viminfo
drwxr-xr-x 3 root root 4096 Oct 6 09:27 TP3/
drwxrwxr-x 7 ansadmin ansadmin 4096 Oct 7 18:53 TPansible/
-rw-r--r-- 1 root root 0 Oct 3 10:12 cible1.txt
-rw-r--r-- 1 root root 173 Oct 4 12:29 copie.yaml
-rw-r--r-- 1 root root 261 Oct 5 11:29 debug.yaml
-rw-r--r-- 1 ansadmin ansadmin 277 Oct 3 17:57 debug1.yaml
-rw-r--r-- 1 root root 190 Oct 4 08:34 exo2.yaml
-rw-r--r-- 1 root root 175 Oct 4 08:44 exo3.yaml
-rw-r--r-- 1 root root 147 Oct 4 13:05 exo4.yaml
-rw-r--r-- 1 root root 247 Oct 3 14:37 fact.yaml
-rw-r--r-- 1 ansadmin ansadmin 179 Oct 3 14:46 fact1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 12:36 git/
-rw-r--r-- 1 root root 428 Oct 3 13:28 handler.yaml
-rw------- 1 ansadmin ansadmin 255 Oct 4 13:34 hello.yaml
-rw------- 1 ansadmin ansadmin 355 Oct 4 13:26 hello.yml
-rw-r--r-- 1 root root 24 Oct 3 13:38 index.html
-rw-r--r-- 1 root root 243 Oct 4 13:01 index.html.j2
-rw-r--r-- 1 ansadmin ansadmin 135 Oct 4 13:01 index.html1.j2
-rw-r--r-- 1 root root 0 Oct 3 14:40 ip.txt
-rw-r--r-- 1 ansadmin ansadmin 247 Oct 4 10:35 item_users.yaml
-rw-r--r-- 1 root root 244 Oct 4 10:20 items.yaml
-rw-r--r-- 1 root root 0 Oct 4 10:24 items_users.yaml
-rw-r--r-- 1 root root 235 Oct 4 10:08 list.yaml
-rw-r--r-- 1 root root 184 Oct 4 13:58 locale.yml
-rw-r--r-- 1 root root 224 Oct 3 12:31 nginx.yaml
-rw-r--r-- 1 root root 254 Oct 4 13:41 play-vars.yaml
-rw------- 1 ansadmin ansadmin 273 Oct 4 13:49 play-vars.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 5 13:44 projet/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 13:14 projet1/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 6 07:29 projet2/
drwxrwxr-x 10 ansadmin ansadmin 4096 Oct 5 14:49 projet3/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 15:09 projet4/
-rw-r--r-- 1 root root 595 Oct 4 09:57 rep.yaml
-rw-r--r-- 1 ansadmin ansadmin 209 Oct 4 12:04 seq.yaml
-rw-r--r-- 1 root root 199 Oct 3 13:01 shell.yml
drwx------ 3 ansadmin ansadmin 4096 Oct 5 10:20 snap/
-rw-r--r-- 1 root root 228 Oct 4 13:14 template.yaml
-rw-r--r-- 1 ansadmin ansadmin 254 Oct 4 13:21 template1.yaml
-rw-r--r-- 1 root root 268 Oct 4 14:35 var_dic.yml
-rw-r--r-- 1 ansadmin ansadmin 280 Oct 4 15:12 var_dic2.yml
-rw-r--r-- 1 root root 337 Oct 5 14:04 var_dic_multi3.yml
-rw-r--r-- 1 ansadmin ansadmin 146 Oct 4 15:07 vars.yml
-rw-r--r-- 1 ansadmin ansadmin 149 Oct 5 10:26 vars2.yml
-rw-r--r-- 1 root root 237 Oct 5 08:08 vars_multi.yml
-rw-r--r-- 1 root root 304 Oct 3 17:58 when.yaml
-rw-r--r-- 1 root root 316 Oct 4 09:32 when1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ cd TP
TP3/ TPansible/
ansadmin@svl200:~$ cd TP
TP3/ TPansible/
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ll
total 56
drwxrwxr-x 7 ansadmin ansadmin 4096 Oct 7 18:53 ./
drwxr-xr-x 13 ansadmin ansadmin 4096 Oct 7 18:49 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:51 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 roles/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ mkdir ../tpansible
ansadmin@svl200:~/TPansible$ ll
total 56
drwxrwxr-x 7 ansadmin ansadmin 4096 Oct 7 18:53 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:51 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 roles/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$ mv roles/ ../tpansible/
ansadmin@svl200:~/TPansible$ ll
total 52
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ../
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 18:51 TPpostgres/
-rw-rw-r-- 1 ansadmin ansadmin 198 Oct 6 12:52 dump.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 130 Oct 6 12:18 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 09:40 hosts_vars/
-rw-rw-r-- 1 ansadmin ansadmin 1037 Oct 6 12:07 main.yml
-rw-r--r-- 1 root root 105 Oct 6 12:10 main_base.yml
-rw-r--r-- 1 root root 0 Oct 6 12:43 main_houcem.yml
-rw-r--r-- 1 root root 1458 Oct 6 14:55 main_postgres.yml
-rw-rw-r-- 1 ansadmin ansadmin 1426 Oct 6 13:03 psql.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 7 18:44 roles1/
-rw-r--r-- 1 ansadmin ansadmin 85 Oct 6 15:19 site.yml
ansadmin@svl200:~/TPansible$
ansadmin@svl200:~/TPansible$ cd
ansadmin@svl200:~$ ll
total 276
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 11 root root 4096 Oct 3 08:32 ../
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 14:52 .ansible/
-rw------- 1 ansadmin ansadmin 31795 Oct 7 13:03 .bash_history
-rw-r--r-- 1 ansadmin ansadmin 220 Oct 3 08:32 .bash_logout
-rw-r--r-- 1 ansadmin ansadmin 3771 Oct 3 08:32 .bashrc
-rw-r--r-- 1 root root 12288 Oct 4 08:51 .exo4.yaml.swp
-rw------- 1 root root 12288 Oct 3 13:11 .handler.yaml.swp
-rw-r--r-- 1 ansadmin ansadmin 807 Oct 3 08:32 .profile
drwx------ 2 ansadmin ansadmin 4096 Oct 6 10:47 .ssh/
-rw------- 1 ansadmin ansadmin 8842 Oct 7 18:49 .viminfo
drwxr-xr-x 3 root root 4096 Oct 6 09:27 TP3/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:57 TPansible/
-rw-r--r-- 1 root root 0 Oct 3 10:12 cible1.txt
-rw-r--r-- 1 root root 173 Oct 4 12:29 copie.yaml
-rw-r--r-- 1 root root 261 Oct 5 11:29 debug.yaml
-rw-r--r-- 1 ansadmin ansadmin 277 Oct 3 17:57 debug1.yaml
-rw-r--r-- 1 root root 190 Oct 4 08:34 exo2.yaml
-rw-r--r-- 1 root root 175 Oct 4 08:44 exo3.yaml
-rw-r--r-- 1 root root 147 Oct 4 13:05 exo4.yaml
-rw-r--r-- 1 root root 247 Oct 3 14:37 fact.yaml
-rw-r--r-- 1 ansadmin ansadmin 179 Oct 3 14:46 fact1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 12:36 git/
-rw-r--r-- 1 root root 428 Oct 3 13:28 handler.yaml
-rw------- 1 ansadmin ansadmin 255 Oct 4 13:34 hello.yaml
-rw------- 1 ansadmin ansadmin 355 Oct 4 13:26 hello.yml
-rw-r--r-- 1 root root 24 Oct 3 13:38 index.html
-rw-r--r-- 1 root root 243 Oct 4 13:01 index.html.j2
-rw-r--r-- 1 ansadmin ansadmin 135 Oct 4 13:01 index.html1.j2
-rw-r--r-- 1 root root 0 Oct 3 14:40 ip.txt
-rw-r--r-- 1 ansadmin ansadmin 247 Oct 4 10:35 item_users.yaml
-rw-r--r-- 1 root root 244 Oct 4 10:20 items.yaml
-rw-r--r-- 1 root root 0 Oct 4 10:24 items_users.yaml
-rw-r--r-- 1 root root 235 Oct 4 10:08 list.yaml
-rw-r--r-- 1 root root 184 Oct 4 13:58 locale.yml
-rw-r--r-- 1 root root 224 Oct 3 12:31 nginx.yaml
-rw-r--r-- 1 root root 254 Oct 4 13:41 play-vars.yaml
-rw------- 1 ansadmin ansadmin 273 Oct 4 13:49 play-vars.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 5 13:44 projet/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 13:14 projet1/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 6 07:29 projet2/
drwxrwxr-x 10 ansadmin ansadmin 4096 Oct 5 14:49 projet3/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 15:09 projet4/
-rw-r--r-- 1 root root 595 Oct 4 09:57 rep.yaml
-rw-r--r-- 1 ansadmin ansadmin 209 Oct 4 12:04 seq.yaml
-rw-r--r-- 1 root root 199 Oct 3 13:01 shell.yml
drwx------ 3 ansadmin ansadmin 4096 Oct 5 10:20 snap/
-rw-r--r-- 1 root root 228 Oct 4 13:14 template.yaml
-rw-r--r-- 1 ansadmin ansadmin 254 Oct 4 13:21 template1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 18:57 tpansible/
-rw-r--r-- 1 root root 268 Oct 4 14:35 var_dic.yml
-rw-r--r-- 1 ansadmin ansadmin 280 Oct 4 15:12 var_dic2.yml
-rw-r--r-- 1 root root 337 Oct 5 14:04 var_dic_multi3.yml
-rw-r--r-- 1 ansadmin ansadmin 146 Oct 4 15:07 vars.yml
-rw-r--r-- 1 ansadmin ansadmin 149 Oct 5 10:26 vars2.yml
-rw-r--r-- 1 root root 237 Oct 5 08:08 vars_multi.yml
-rw-r--r-- 1 root root 304 Oct 3 17:58 when.yaml
-rw-r--r-- 1 root root 316 Oct 4 09:32 when1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ ll
total 12
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ../
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 roles/
ansadmin@svl200:~/tpansible$ cd .
./ ../
ansadmin@svl200:~/tpansible$ cd ./
ansadmin@svl200:~/tpansible$ ll
total 12
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ../
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 roles/
ansadmin@svl200:~/tpansible$ cd ../
ansadmin@svl200:~$ ll
total 276
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 11 root root 4096 Oct 3 08:32 ../
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 14:52 .ansible/
-rw------- 1 ansadmin ansadmin 31795 Oct 7 13:03 .bash_history
-rw-r--r-- 1 ansadmin ansadmin 220 Oct 3 08:32 .bash_logout
-rw-r--r-- 1 ansadmin ansadmin 3771 Oct 3 08:32 .bashrc
-rw-r--r-- 1 root root 12288 Oct 4 08:51 .exo4.yaml.swp
-rw------- 1 root root 12288 Oct 3 13:11 .handler.yaml.swp
-rw-r--r-- 1 ansadmin ansadmin 807 Oct 3 08:32 .profile
drwx------ 2 ansadmin ansadmin 4096 Oct 6 10:47 .ssh/
-rw------- 1 ansadmin ansadmin 8842 Oct 7 18:49 .viminfo
drwxr-xr-x 3 root root 4096 Oct 6 09:27 TP3/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:57 TPansible/
-rw-r--r-- 1 root root 0 Oct 3 10:12 cible1.txt
-rw-r--r-- 1 root root 173 Oct 4 12:29 copie.yaml
-rw-r--r-- 1 root root 261 Oct 5 11:29 debug.yaml
-rw-r--r-- 1 ansadmin ansadmin 277 Oct 3 17:57 debug1.yaml
-rw-r--r-- 1 root root 190 Oct 4 08:34 exo2.yaml
-rw-r--r-- 1 root root 175 Oct 4 08:44 exo3.yaml
-rw-r--r-- 1 root root 147 Oct 4 13:05 exo4.yaml
-rw-r--r-- 1 root root 247 Oct 3 14:37 fact.yaml
-rw-r--r-- 1 ansadmin ansadmin 179 Oct 3 14:46 fact1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 12:36 git/
-rw-r--r-- 1 root root 428 Oct 3 13:28 handler.yaml
-rw------- 1 ansadmin ansadmin 255 Oct 4 13:34 hello.yaml
-rw------- 1 ansadmin ansadmin 355 Oct 4 13:26 hello.yml
-rw-r--r-- 1 root root 24 Oct 3 13:38 index.html
-rw-r--r-- 1 root root 243 Oct 4 13:01 index.html.j2
-rw-r--r-- 1 ansadmin ansadmin 135 Oct 4 13:01 index.html1.j2
-rw-r--r-- 1 root root 0 Oct 3 14:40 ip.txt
-rw-r--r-- 1 ansadmin ansadmin 247 Oct 4 10:35 item_users.yaml
-rw-r--r-- 1 root root 244 Oct 4 10:20 items.yaml
-rw-r--r-- 1 root root 0 Oct 4 10:24 items_users.yaml
-rw-r--r-- 1 root root 235 Oct 4 10:08 list.yaml
-rw-r--r-- 1 root root 184 Oct 4 13:58 locale.yml
-rw-r--r-- 1 root root 224 Oct 3 12:31 nginx.yaml
-rw-r--r-- 1 root root 254 Oct 4 13:41 play-vars.yaml
-rw------- 1 ansadmin ansadmin 273 Oct 4 13:49 play-vars.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 5 13:44 projet/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 13:14 projet1/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 6 07:29 projet2/
drwxrwxr-x 10 ansadmin ansadmin 4096 Oct 5 14:49 projet3/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 15:09 projet4/
-rw-r--r-- 1 root root 595 Oct 4 09:57 rep.yaml
-rw-r--r-- 1 ansadmin ansadmin 209 Oct 4 12:04 seq.yaml
-rw-r--r-- 1 root root 199 Oct 3 13:01 shell.yml
drwx------ 3 ansadmin ansadmin 4096 Oct 5 10:20 snap/
-rw-r--r-- 1 root root 228 Oct 4 13:14 template.yaml
-rw-r--r-- 1 ansadmin ansadmin 254 Oct 4 13:21 template1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 18:57 tpansible/
-rw-r--r-- 1 root root 268 Oct 4 14:35 var_dic.yml
-rw-r--r-- 1 ansadmin ansadmin 280 Oct 4 15:12 var_dic2.yml
-rw-r--r-- 1 root root 337 Oct 5 14:04 var_dic_multi3.yml
-rw-r--r-- 1 ansadmin ansadmin 146 Oct 4 15:07 vars.yml
-rw-r--r-- 1 ansadmin ansadmin 149 Oct 5 10:26 vars2.yml
-rw-r--r-- 1 root root 237 Oct 5 08:08 vars_multi.yml
-rw-r--r-- 1 root root 304 Oct 3 17:58 when.yaml
-rw-r--r-- 1 root root 316 Oct 4 09:32 when1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ ll
total 12
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ../
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 roles/
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ls -lrt
total 4
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 18:53 roles
ansadmin@svl200:~/tpansible$ cd roles/
ansadmin@svl200:~/tpansible/roles$ ls
README.md defaults files group_vars handlers hosts_vars meta
tasks templates tests vars
ansadmin@svl200:~/tpansible/roles$ cd ..
ansadmin@svl200:~/tpansible$ tree
.
└── roles
├── 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
12 directories, 9 files
ansadmin@svl200:~/tpansible$ mkdir roles/postgres
ansadmin@svl200:~/tpansible$ cd roles/
ansadmin@svl200:~/tpansible/roles$ ll
total 56
drwxrwxr-x 13 ansadmin ansadmin 4096 Oct 7 19:02 ./
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 18:57 ../
-rw-rw-r-- 1 ansadmin ansadmin 1328 Oct 6 15:04 README.md
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 defaults/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 files/
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 6 15:10 group_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 handlers/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:10 hosts_vars/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 meta/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:02 postgres/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tasks/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 templates/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:04 tests/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 6 15:15 vars/
ansadmin@svl200:~/tpansible/roles$ mv ./ ../ README.md defaults files/ group_vars/
handlers/ hosts_vars/ meta/ tasks/ templates/ tests/ vars/ postgres/
mv: cannot move './' to 'postgres/.': Device or resource busy
mv: cannot move '../' to 'postgres/..': Device or resource busy
ansadmin@svl200:~/tpansible/roles$ mv README.md defaults files/ group_vars/ handlers/
hosts_vars/ meta/ tasks/ templates/ tests/ vars/ postgres/
mv: cannot stat 'README.md': No such file or directory
mv: cannot stat 'defaults': No such file or directory
mv: cannot stat 'files/': No such file or directory
mv: cannot stat 'group_vars/': No such file or directory
mv: cannot stat 'handlers/': No such file or directory
mv: cannot stat 'hosts_vars/': No such file or directory
mv: cannot stat 'meta/': No such file or directory
mv: cannot stat 'tasks/': No such file or directory
mv: cannot stat 'templates/': No such file or directory
mv: cannot stat 'tests/': No such file or directory
mv: cannot stat 'vars/': No such file or directory
ansadmin@svl200:~/tpansible/roles$
ansadmin@svl200:~/tpansible/roles$ ls -lrt
total 4
drwxrwxr-x 12 ansadmin ansadmin 4096 Oct 7 19:04 postgres
ansadmin@svl200:~/tpansible/roles$
ansadmin@svl200:~/tpansible/roles$ ls
postgres
ansadmin@svl200:~/tpansible/roles$ cd ..
ansadmin@svl200:~/tpansible$ tree
.
└── roles
└── postgres
├── 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
13 directories, 9 files
ansadmin@svl200:~/tpansible$ cd ..
ansadmin@svl200:~$ ls
TP3 copie.yaml exo2.yaml fact.yaml handler.yaml
index.html ip.txt items_users.yaml nginx.yaml
projet projet3 seq.yaml template.yaml var_dic.yml
vars.yml
TPansible debug.yaml exo3.yaml fact1.yaml hello.yaml
index.html.j2 item_users.yaml list.yaml play-vars.yaml
projet1 projet4 shell.yml template1.yaml var_dic2.yml
vars2.yml
cible1.txt debug1.yaml exo4.yaml git hello.yml
index.html1.j2 items.yaml locale.yml play-vars.yml
projet2 rep.yaml snap tpansible var_dic_multi3.yml
vars_multi
ansadmin@svl200:~$ cd TPansible/
ansadmin@svl200:~/TPansible$ ls
TPpostgres dump.yml group_vars hosts.yml hosts_vars main.yml
main_base.yml main_houcem.yml main_postgres.yml psql.yml roles1
site.yml
ansadmin@svl200:~/TPansible$ 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:~$ ls
TP3 copie.yaml exo2.yaml fact.yaml handler.yaml
index.html ip.txt items_users.yaml nginx.yaml
projet projet3 seq.yaml template.yaml var_dic.yml
vars.yml
TPansible debug.yaml exo3.yaml fact1.yaml hello.yaml
index.html.j2 item_users.yaml list.yaml play-vars.yaml
projet1 projet4 shell.yml template1.yaml var_dic2.yml
vars2.yml
cible1.txt debug1.yaml exo4.yaml git hello.yml
index.html1.j2 items.yaml locale.yml play-vars.yml
projet2 rep.yaml snap tpansible var_dic_multi3.yml
vars_multi
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ls
geerlingguy.apache group_vars hosts.yml hosts_vars site.yml
ansadmin@svl200:~/projet4$ cp group_vars/ hosts_vars/ hosts.yml site.yml
../tpansible/
cp: -r not specified; omitting directory 'group_vars/'
cp: -r not specified; omitting directory 'hosts_vars/'
ansadmin@svl200:~/projet4$ cp -r group_vars hosts_vars hosts.yml site.yml
../tpansible/
ansadmin@svl200:~/projet4$ cd ..
ansadmin@svl200:~$ ls
TP3 copie.yaml exo2.yaml fact.yaml handler.yaml
index.html ip.txt items_users.yaml nginx.yaml
projet projet3 seq.yaml template.yaml var_dic.yml
vars.yml
TPansible debug.yaml exo3.yaml fact1.yaml hello.yaml
index.html.j2 item_users.yaml list.yaml play-vars.yaml
projet1 projet4 shell.yml template1.yaml var_dic2.yml
vars2.yml
cible1.txt debug1.yaml exo4.yaml git hello.yml
index.html1.j2 items.yaml locale.yml play-vars.yml
projet2 rep.yaml snap tpansible var_dic_multi3.yml
vars_multi
ansadmin@svl200:~$
ansadmin@svl200:~$ ls
TP3 copie.yaml exo2.yaml fact.yaml handler.yaml
index.html ip.txt items_users.yaml nginx.yaml
projet projet3 seq.yaml template.yaml var_dic.yml
vars.yml
TPansible debug.yaml exo3.yaml fact1.yaml hello.yaml
index.html.j2 item_users.yaml list.yaml play-vars.yaml
projet1 projet4 shell.yml template1.yaml var_dic2.yml
vars2.yml
cible1.txt debug1.yaml exo4.yaml git hello.yml
index.html1.j2 items.yaml locale.yml play-vars.yml
projet2 rep.yaml snap tpansible var_dic_multi3.yml
vars_multi
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
│ └── postgres
│ ├── 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
└── site.yml
15 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim group_vars/all.yml
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$ cd hosts_vars/
ansadmin@svl200:~/tpansible/hosts_vars$ ls
ansadmin@svl200:~/tpansible/hosts_vars$ cd ..
ansadmin@svl200:~/tpansible$ cd ..
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
│ ├── 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 tpansible/
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│ └── postgres
│ ├── 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
└── site.yml
15 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/group_vars/all.yml/all.yml
ansadmin@svl200:~/tpansible$ rm roles/postgres/group_vars/
rm: cannot remove 'roles/postgres/group_vars/': Is a directory
ansadmin@svl200:~/tpansible$ rm -r roles/postgres/group_vars/
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── hosts_vars
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── site.yml
13 directories, 11 files
ansadmin@svl200:~/tpansible$ rm -r roles/postgres/hosts_vars/
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── site.yml
12 directories, 11 files
ansadmin@svl200:~/tpansible$ cd roles/postgres/te
templates/ tests/
ansadmin@svl200:~/tpansible$ cd roles/postgres/te
templates/ tests/
ansadmin@svl200:~/tpansible$ cd roles/postgres/te
templates/ tests/
ansadmin@svl200:~/tpansible$ cd roles/postgres/templates/
ansadmin@svl200:~/tpansible$ cd roles/postgres/templates/
ansadmin@svl200:~/tpansible/roles/postgres/templates$ ls
ansadmin@svl200:~/tpansible/roles/postgres/templates$ cd
ansadmin@svl200:~$
ansadmin@svl200:~$ ls
TP3 debug.yaml exo4.yaml handler.yaml index.html.j2
items.yaml nginx.yaml projet1 rep.yaml
template.yaml var_dic2.yml vars_multi.yml
TPansible debug1.yaml fact.yaml hello.yaml index.html1.j2
items_users.yaml play-vars.yaml projet2 seq.yaml template1.yaml
var_dic_multi3.yml when.yaml
cible1.txt exo2.yaml fact1.yaml hello.yml ip.txt
list.yaml play-vars.yml projet3 shell.yml tpansible
vars.yml when1.yaml
copie.yaml exo3.yaml git index.html item_users.yaml
locale.yml projet projet4 snap
var_dic.yml vars2.yml
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ls
geerlingguy.apache group_vars hosts.yml hosts_vars site.yml
ansadmin@svl200:~/projet4$ cd geerlingguy.apache/
.github/ defaults/ handlers/ meta/ molecule/ tasks/
templates/ vars/
ansadmin@svl200:~/projet4$ cd ../projet1
ansadmin@svl200:~/projet1$ ls
group_vars hosts.yml hosts_vars roles site.yml
ansadmin@svl200:~/projet1$ cd roles/apache/
handlers/ tasks/ templates/ vars/
ansadmin@svl200:~/projet1$ cp roles/apache/templates/index.html.j2 ../tpansible/
group_vars/ hosts.yml hosts_vars/ roles/ site.yml
ansadmin@svl200:~/projet1$ cp roles/apache/templates/index.html.j2
../tpansible/roles/postgres/
README.md defaults/ files/ handlers/ meta/ tasks/
templates/ tests/ vars/
ansadmin@svl200:~/projet1$ cp roles/apache/templates/index.html.j2
../tpansible/roles/postgres/t
tasks/ templates/ tests/
ansadmin@svl200:~/projet1$ cp roles/apache/templates/index.html.j2
../tpansible/roles/postgres/te
templates/ tests/
ansadmin@svl200:~/projet1$ cp roles/apache/templates/index.html.j2
../tpansible/roles/postgres/te
templates/ tests/
ansadmin@svl200:~/projet1$ cp roles/apache/templates/index.html.j2
../tpansible/roles/postgres/templates/
ansadmin@svl200:~/projet1$
ansadmin@svl200:~/projet1$ cd ../tpansible/
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── site.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ su vim hosts.yml
su: user vim does not exist
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── site.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ cd ../projet1
ansadmin@svl200:~/projet1$ ls
group_vars hosts.yml hosts_vars roles site.yml
ansadmin@svl200:~/projet1$ cd hosts_vars/
ansadmin@svl200:~/projet1/hosts_vars$ ls
ansadmin@svl200:~/projet1/hosts_vars$ cd ../../tpansible/
ansadmin@svl200:~/tpansible$ tree
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── site.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/handlers/main.yml
ansadmin@svl200:~/tpansible$ cd ../projet1
ansadmin@svl200:~/projet1$ tree
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 roles/apache/handlers/main.yml
ansadmin@svl200:~/projet1$ sudo vim roles/apache/t
tasks/ templates/
ansadmin@svl200:~/projet1$ sudo vim roles/apache/t
tasks/ templates/
ansadmin@svl200:~/projet1$ sudo vim roles/apache/tasks/main.yml
ansadmin@svl200:~/projet1$ sudo vim ../tpansible/roles/postgres/tasks/main.yml
ansadmin@svl200:~/projet1$ sudo vim ../tpansible/roles/postgres/handlers/main.yml
ansadmin@svl200:~/projet1$ cd
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ sudo vim site.yml
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/templates/index.html.j2
ansadmin@svl200:~/tpansible$ ansible-playbook
group_vars/ hosts.yml hosts_vars/ roles/ site.yml
ansadmin@svl200:~/tpansible$ ansible-playbook hosts
hosts.yml hosts_vars/
ansadmin@svl200:~/tpansible$ ansible-playbook hosts.yml site.yml
[WARNING]: While constructing a mapping from /home/ansadmin/tpansible/hosts.yml, line
3, column 7, found a duplicate dict key (cible1). Using last defined value only.
ERROR! A playbook must be a list of plays, got a <class
'ansible.parsing.yaml.objects.AnsibleMapping'> instead
all:
^ here
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ansible-playbook
group_vars/ hosts.yml hosts_vars/ roles/ site.yml
ansadmin@svl200:~/tpansible$ ansible-playbook roles/postgres/t
tasks/ templates/ tests/
ansadmin@svl200:~/tpansible$ ansible-playbook roles/postgres/tasks/main.yml
TASK [package_python]
*************************************************************************************
******************************************************************************
ok: [146.59.158.16]
TASK [acl]
*************************************************************************************
*************************************************************************************
****
ok: [146.59.158.16]
TASK [BD]
*************************************************************************************
*************************************************************************************
*****
ok: [146.59.158.16]
TASK [sauvegarde]
*************************************************************************************
**********************************************************************************
changed: [146.59.158.16]
TASK [BD]
*************************************************************************************
*************************************************************************************
*****
ok: [146.59.158.16]
PLAY RECAP
*************************************************************************************
*************************************************************************************
****
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ cd
ansadmin@svl200:~$ cd projet4
ansadmin@svl200:~/projet4$ ls
geerlingguy.apache group_vars hosts.yml hosts_vars site.yml
ansadmin@svl200:~/projet4$ ansible-playbook 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! A playbook must be a list of plays, got a <class
'ansible.parsing.yaml.objects.AnsibleMapping'> instead
all:
^ here
ansadmin@svl200:~/projet4$ ansible-playbook hosts_vars site.yml
ERROR! the playbook: hosts_vars does not appear to be a file
ansadmin@svl200:~/projet4$ ansible-playbook site.yml
TASK [geerlingguy.apache : Ensure Apache has selected state and enabled on boot.]
*************************************************************************************
******************
ok: [141.95.160.133]
changed: [146.59.158.16]
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=15 changed=1 unreachable=0
failed=0 skipped=5 rescued=0 ignored=0
146.59.158.16 : ok=16 changed=6 unreachable=0
failed=0 skipped=5 rescued=0 ignored=0
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim site.yml
ansadmin@svl200:~/tpansible$ sudo roles/postgres/tasks/main.yml
sudo: roles/postgres/tasks/main.yml: command not found
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/tasks/main.yml
ansadmin@svl200:~/tpansible$ mv site.yml psql.yml
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
ERROR! conflicting action statements: hosts, gather_facts
tasks:
^ here
ansadmin@svl200:~/tpansible$ cd
ansadmin@svl200:~$ cd projet1
ansadmin@svl200:~/projet1$ ls
group_vars hosts.yml hosts_vars roles site.yml
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 roles/apache/tasks/main.yml
ansadmin@svl200:~/projet1$ cd
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml roles
ansadmin@svl200:~/tpansible$ tree
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/tasks/main.yml
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
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=8 changed=6 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
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=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/tasks/main.yml
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
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=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
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=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/vars/main.yml
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
PLAY [install postgres]
*************************************************************************************
*************************************************************************************
***********
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=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
12 directories, 12 files
ansadmin@svl200:~/tpansible$ sudo gro
groff grog grops grotty
group_vars/ groupadd groupdel groupmems groupmod groups
growpart
ansadmin@svl200:~/tpansible$ sudo vim group_vars/all.yml
ansadmin@svl200:~/tpansible$ sudo vim psql.yml
ansadmin@svl200:~/tpansible$ sudo vim group_vars/all.yml
ansadmin@svl200:~/tpansible$ sudo vim group_vars/all.yml
ansadmin@svl200:~/tpansible$ sudo host
Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time]
[-R number] [-m flag] hostname [server]
-a is equivalent to -v -t ANY
-A is like -a but omits RRSIG, NSEC, NSEC3
-c specifies query class for non-IN data
-C compares SOA records on authoritative nameservers
-d is equivalent to -v
-l lists all hosts in a domain, using AXFR
-m set memory debugging flag (trace|record|usage)
-N changes the number of dots allowed before root lookup is done
-r disables recursive processing
-R specifies number of retries for UDP packets
-s a SERVFAIL response should stop query
-t specifies the query type
-T enables TCP/IP mode
-U enables UDP mode
-v enables verbose output
-V print version number and exit
-w specifies to wait forever for a reply
-W specifies how long to wait for a reply
-4 use IPv4 query transport only
-6 use IPv6 query transport only
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ sudo vim
vim vim.basic vim.tiny vimdiff vimtutor
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$ sudo vim psql.yml
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
PLAY RECAP
*************************************************************************************
*************************************************************************************
************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/tasks/main.yml
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
PLAY RECAP
*************************************************************************************
*************************************************************************************
************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 12 files
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansib
ansadmin@svl200:~/tpansib
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpa
ansadmin@svl200:~/tp
ansadmin@svl200:~/tp
ansadmin@svl200:~/t
ansadmin@svl200:~
ansadmin@svl200:~
ansadmin@svl200:
ansadmin@svl200
ansadmin@svl20
0:~/tpansible$
ansadmin@svl
200:~/tpansi
ansadmin@svl
200:~/tpansi
ansadmin@svl
200:~/tpansi
ansadmin@sv
l200:~/tpan
ansadmin@s
vl200:~/tp
ansadmin@
svl200:~/
tpansible
ansadmin
@svl200:
~/tpansi
ansadmin
@svl200:
~/tpansi
ansadmi
n@svl20
0:~/tpa
nsible$
ansadmin
@svl200:
~/tpansi
ansadmin
@svl200:
~/tpansi
ansadmin@
svl200:~/
tpansible
ansadmin@s
vl200:~/tp
ansadmin@sv
l200:~/tpan
ansadmin@svl2
00:~/tpansibl
ansadmin@svl2
00:~/tpansibl
ansadmin@svl2
00:~/tpansibl
ansadmin@svl20
0:~/tpansible$
ansadmin@svl200
ansadmin@svl200:
ansadmin@svl200:~
ansadmin@svl200:~/t
ansadmin@svl200:~/t
ansadmin@svl200:~/tpa
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpansi
ansadmin@svl200:~/tpansi
ansadmin@svl200:~/tpansib
ansadmin@svl200:~/tpansibl
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible
ansadmin@svl200:~/tpansibl
ansadmin@svl200:~/tpansib
ansadmin@svl200:~/tpans
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tp
ansadmin@svl200:~/tp
ansadmin@svl200:~/tp
ansadmin@svl200:~/
ansadmin@svl200:~/
ansadmin@svl200:
ansadmin@svl200
ansadmin@svl200
ansadmin@svl200:
ansadmin@svl200:~/
ansadmin@svl200:~/
ansadmin@svl200:~/tp
ansadmin@svl200:~/tp
ansadmin@svl200:~/tpan
ansadmin@svl200:~/tpansi
ansadmin@svl200:~/tpansi
ansadmin@svl200:~/tpansi
ansadmin@svl200:~/tpansi
ansadmin@svl200:~/tpansib
ansadmin@svl200:~/tpansibl
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$
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
[email protected]'s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v22.0 •
│
│ (SSH client, X server and network tools)
│
│
│
│ → SSH session to [email protected]
│
│ • 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.
│
└──────────────────────────────────────────────────────────────────────┘
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
https://ubuntu.com/blog/microk8s-memory-optimisation
PLAY RECAP
*************************************************************************************
**********************************************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
12 directories, 12 files
ansadmin@svl200:~/tpansible$ cd
ansadmin@svl200:~$ exit
logout
ofi03@svl200:~$
ofi03@svl200:~$ history
1 clear
2 usermod -aG sudo etl3
3 su - etl
4 clear
5 sudo su -
6 ls -lrt
7 chmod u=rw,g=rw,o=r system.log
8 ls -lrt
9 clear
10 ls -lrt
11 chmod 777 system.log
12 ls -lrt
13 chmod u=rw,g=rw,o=r system.log
14 clear
15 ls -lrt
16 chmod a+rw system.log
17 ls -lrt
18 clear
19 chmod 755 -R system.log
20 ls -lrt
21 cd
22 cd profile/
23 cd
24 sudo touch test.log
25 ls -lrt
26 clear
27 sudo systemctl start cron.service
28 sudo systemctl is-active cron.service
29 sudo systemctl stop cron.service
30 sudo systemctl is-active cron.service
31 sudo systemctl restart cron.service
32 sudo systemctl is-active cron.service
33 sudo systemctl -t help
34 sudo systemctl list-init-files -t init services
35 sudo systemctl list-init-files -t init service
36 sudo systemctl list-init-files -t service
37 sudo systemctl list-init-file -t service
38 clear
39 sudo systemctl list-unit-files -t service
40 clear
41 sudo systemctl list-unit -t service
42 sudo systemctl list-units -t service
43 clear
44 sudo dpkg --get -selections
45 sudo dpkg --get -selection
46 sudo dpkg --get-selections
47 sudo dpkg --get-selections | grep vim
48 sudo dpkg --get-selections | grep ucf
49 sudo dpkg -l cron
50 sudo dpkg -l cron |grep ii
51 sudo dpkg -l cron |grep ixgh
52 sudo dpkg -r cron
53 clear
54 sudo apt update
55 sudo get install zip
56 sudo apt install zip
57 sudo dpkg --get-selections zip
58 sudo dpkg --get-selections
59 sudo dpkg --get-selections | grep zip
60 clear
61 sudo apt update
62 apt list --upgradable
63 sudo apt upgrade
64 sudo apt update
65 cat /etc/apt/source.lists
66 cat /etc/apt/source.list
67 cat /etc/apt/sources.list
68 sudo apt-cache search apache2
69 sudo apt-cache show apache2
70 sudo apt-cache find apache2
71 sudo apt-cache print apache2
72 sudo apt-cache view apache2
73 sudo apt-cache depends apache2
74 sudo apt-cache rdepends apache2
75 clear
76 crontab -e
77 clear
78 crontab -e
79 clear
80 crontab -e
81 clear
82 crontab -e
83 clear
84 crontab -
85 clear
86 crontab -e
87 clear
88 crontab -e
89 cd
90 ls
91 clear
92 ls
93 crontab -e
94 clear
95 rm crontab -e
96 clear
97 sudo crontab -e
98 clear
99 vim a1.sh
100 cd
101 ls
102 cd /etc/cloud/templates/
103 ll
104 cd ..
105 ll
106 cd
107 cd /etc/cloud/templates/
108 ll
109 xclock
110 cd
111 xclock
112 exit
113 cd
114 pwd
115 mkdir Unix Python
116 ls
117 mkdir Unix/TP1 Unix/TP2
118 cd Unix
119 ls
120 mkdir Python/TP1 Python/TP2
121 cd
122 mkdir Python/TP1 Python/TP2
123 cd Python
124 ls
125 rm -r TP1 TP2
126 ls
127 cd
128 cd Unix
129 ls
130 cp TP1 TP2 /Python
131 cp TP1 TP2 ./Python
132 cd
133 cd Unix
134 ls
135 cp TP1 TP2 ../Python
136 cp -r TP1 TP2 ../Python
137 cd
138 cd Python
139 ls
140 mkdir cd
141 cd
142 mkdir -r seance1 seance2 /Unix/TP1/
143 mkdir /Unix/TP1/seance1 /Unix/TP1/seance2
144 mkdir -p /Unix/TP1/seance1 /Unix/TP1/seance2
145 cd
146 cd Unix
147 cd TP1
148 ls
149 mkdir seance1 seance2
150 ls
151 cd
152 ls-lrt
153 ls -lrt Python
154 rmdir cd
155 cdPython
156 cd Python
157 rmdir cd
158 ls -lrt Pyton
159 ls -lrt Python
160 ls
161 tree
162 sudo snap install tree
163 cd
164 tree
165 touch /Unix/TP1/seance1/exo{1,2}
166 cd /Unix/TP1/seance
167 cd /Unix/TP1/seance1
168 cd
169 ls
170 cd Unix
171 ls
172 cd TP1
173 ls
174 cd seance1
175 touch exo{1,2}
176 cd
177 cd Python
178 ls
179 cd
180 cd TP2
181 touch exo{1,2}
182 tree
183 cd /Python/TP2
184 cd Python/TP2
185 ls
186 touch exo{1,2}
187 ls
188 tree
189 cd
190 tree
191 cd
192 tree
193 cd Python/TP1
194 ls
195 cd ../Unix/TP2
196 cd ./Unix/TP2
197 cd
198 cd Python/TP1
199 ls
200 cd /Unix/TP2
201 cd ./Unix/TP2
202 cd ../../Unix/TP2
203 cd
204 cd Python
205 cd TP1
206 rmdir TP1
207 rmdir -r TP1
208 ls
209 rmdir ../TP1
210 cd
211 cd Python
212 ls
213 cd
214 rmdir Python/TP2
215 cd Python
216 ls
217 rmdir TP2
218 rm -r TP2
219 Tree
220 cd
221 Tree
222 tree
223 cd Python
224 ls
225 cd
226 cd Unix/TP1
227 ls
228 mv Unix/TP1/seance1/exo1 Unix/TP1/exo1
229 mv Unix/TP1/seance1/exo1 Unix/TP1
230 cd
231 cd Unix
232 ls
233 cd TP1
234 ls
235 cd seance1
236 ls
237 mv exo1 ../../TP1
238 cd ../../
239 ls
240 cd TP1
241 ls
242 cd
243 rm -R Unix/TP1/seance1 Unix/TP1/ex1
244 rm -R Unix/TP1/seance1 Unix/TP1/exo1
245 cd Unix
246 ls
247 cd TP1
248 ls
249 tree
250 cd
251 tree
252 cd Pyhton/TP1
253 cd Python/TP1
254 cd Python
255 cd Python/TP1/
256 cd
257 cd Python/TP1
258 cd Python/TP1/
259 cd Python
260 ls
261 cd Unix/TP1
262 cd Unix
263 cd
264 cd Unix
265 ls
266 cd TP2
267 ls
268 cd TP1
269 cd ../
270 cd
271 ls
272 cd Unix
273 ls
274 cd TP2
275 ls
276 cd ../
277 cd TP1
278 ls
279 rm -r seance2
280 ls
281 trecd
282 tree
283 *tree
284 tree
285 cd
286 tree
287 cd Python/Unix
288 cd Python/Unix/
289 cd Unix/TP1
290 ls
291 touch exo{1,2}
292 ls
293 cd
294 tree
295 sudo su -
296 l
297 cd Unix/TP1
298 ls-lrt
299 cd
300 cd Unix
301 ls -lrt
302 sudo chown Exp1 TP1
303 chown Exp1 TP1
304 sudo chown Exp1 TP1
305 cd
306 sudo chown Exp1 TP1
307 sudo chown exp1 TP1
308 ls -lrt
309 cat /etc/passwd
310 sudo chown exp1 TP1
311 sudo chown exp1 /Pthon/TP1
312 sudo chown exp1 /TP1
313 cat /etc/passwd | grep exp
314 ls -lrt Unix
315 sudo chown -R exp1 Unix/TP1
316 ls -lrt Unix
317 sudo chown -R exp2 Python/
318 cd TP/
319 cd TP1/
320 cd TP2/
321 sudo chown -R exp2 Python
322 ls -lrt
323 cd
324 ls -lrt
325 cdcd
326 cd -lrt Python
327 ls -lrt Python
328 cd Unix/TP1/seance1
329 cd Unix/TP2/seance1
330 cd Unix
331 ls
332 cd TP1
333 ls
334 ls -s cd
335 cd
336 cd Unix/TP1/
337 ls
338 ls -s Unix/TP1/exo1 lien
339 ls -s Unix/TP1/ lien
340 cd
341 sudo apt install zip
342 tar -czvf system.tar.gz Unix
343 tar -cJvf system.tar.xz Unix
344 tar -cJvf system.tar.bz2 Unix
345 tar -cjvf system.tar.bz2 Unix
346 cd
347 ls -lrt
348 tar -czvf Unix.tar.gz
349 tar -czvf Unix.tar.gz Unix
350 cd
351 ls
352 cd Unix
353 ls
354 cd system
355 cd
356 cd system
357 sudo cd system
358 l
359 cd
360 tar -czvf Unix.tar.gz Unix
361 tar -cxvf Unix.tar.gz Unix
362 mkdir Python/data
363 tar -cxvf Unix.tar.gz Python/data
364 tar -cxvf Unix.tar.gz Python/data/
365 su exp2
366 sudo netsat -patune | grep ssh
367 su - epx2
368 su -epx2
369 clear
370 ssh-keygen -t rsa
371 y
372 ssh-keygen -t rsa
373 ssh-copy-id -i /home/ofi03/.ssh/id_rsa.pub -p 55600 [email protected]
374 ssh-copy-id -i /home/ofi03/.ssh/id_rsa.pub -p 55600 [email protected]
375 ps -ef | grep tomcat
376 cd /etc/systemd/system/
377 vim tomcat.service
378 sudo vim tomcat.service
379 sudo systemctl restart tomcat.service
380 sudo systemctl daemon-reload tomcat.service
381 sudo systemctl daemon-reload
382 sudo systemctl restart tomcat.service
383 vim tomcat.service
384 ps -ef | grep tomcat
385 sudo cd /opt/tomcat/bin
386 cd /opt/tomcat/bin
387 sudo vim catalina.sh
388 sudo vim setenv.sh
389 sudo systemctl restart tomcat.service
390 ps -ef | grep tomcat
391 cd
392 ps -ef | grep tomcat
393 sudo systemctl status tomcat.service
394 journalctl -u tomcat
395 sudo journalctl -u tomcat
396 nano /etc/systemd/system/tomcat.service
397 sudo journalctl -u tomcat
398 sudo systemctl restart tomcat.service
399 ps -ef | grep tomcat
400 journalctl -u tomcat
401 ps -ef | grep tomcat
402 sudo vim setenv.sh
403 sudo systemctl daemon-reload
404 sudo systemctl restart tomcat.service
405 cd /opt/tomcat/bin
406 sudo vim setenv.sh
407 sudo systemctl restart tomcat.service
408 ps -ef | grep tomcat
409 sudo su -l tomcat -s /bin/bash -c 'jmap -dump:format=b, file=dump1.hprof
286223'
410 ps -ef | grep tomcat
411 sudo su -l tomcat -s /bin/bash -c 'jmap -dump:format=b, file=dump1.hprof
91901'
412 sudo su -l tomcat -s /bin/bash -c 'jmap -dump:format=b,file=dump1.hprof
91901'
413 ls -lrt
414 cd /opt/tomcat
415 ls -lrt
416 cd
417 ls -lrt
418 cd /opt/tomcat
419 mv dump1.hprof /home/ofi03/
420 sudo mv dump1.hprof /home/ofi03/
421 sudo chown ofi03:ofi03 /home/ofi03/dump1.hprof
422 d /bin/setenv
423 cd /bin
424 sudo vim setenv.sh
425 cd /bin/
426 ls
427 sudo vim setenv.sh
428 cd /opt/
429 ls-lrt
430 ls -lrt
431 cd /etc/postgresql/12/
432 ls -lrt
433 cd main
434 ls -lrt
435 sudo vim postgresql.conf
436 cd
437 cd /etc/postgresql/12/main
438 ls -lrt
439 sudo vim postgresql.conf
440 cd /etc/postgresql/12/main
441 ls -lrt
442 sudo vim postgresql.conf
443 ls -lrt
444 sudo vim pg_hba.conf
445 systemctl status postgresql
446 ps -aux | grep postgresql
447 pg_c
448 sudo pg_ctlcluster 12 main status
449 psql -h 146.59.156.114 -p 5432 postgres postgres
450 sudo pg_ctlcluster 12 main status
451 psql -h 146.59.156.114 -p 5432 postgres postgres
452 systemctl restart postgresql
453 psql -h 146.59.156.114 -p 5432 postgres postgres
454 sudo vim pg_hba.conf
455 psql -h 146.59.156.114 -p 5432 postgres postgres
456 systemctl restart postgresql
457 sudo pg_ctlcluster 12 main status
458 psql -h 146.59.156.114 -p 5432 postgres postgres
459 sudo su -
460 sudo vim pg_hba.conf
461 psql -h 146.59.156.114 -p 5432 postgres postgres
462 sudo vim pg_hba.conf
463 psql -h 146.59.156.114 -p 5432 postgres postgres
464 sudo su -
465 sudo vim pg_hba.conf
466 cd
467 cd /etc/postgresql/12/main/
468 ls -lrt
469 sudo vim pg_hba.conf
470 cd /etc/postgresql/12/main/
471 sudo vim pg_hba.conf
472 cd /etc/postgresql/12/main/
473 sudo vim pg_hba.conf
474 sudo su -
475 systemctl status tomcat
476 shutdown
477 systemctl shutdown tomcat
478 cd /opt/tomcat
479 ls -lrt
480 shutdown
481 systemctl stop tomcat
482 systemctl status tomcat
483 systemctl stop tomcat.service
484 systemctl status tomcat
485 sudo su -
486 systemctl restart postgresql
487 sudo su -
488 systemctl restart postgresql
489 systemctl status postgresql.service
490 systemctl restart postgresql
491 sudo su -
492 systemctl status postgresql.service
493 cd /etc/postgresql/12/main
494 ls -lrt
495 systemctl status postgresql.service
496 sudo su -
497 cd
498 sudo apt install postgresql postgresql contrib
499 sudo apt install postgresql postgresql-contrib
500 ls -lrt
501 cd /etc/postgresql/12/main
502 sudo vim postgresql.conf
503 cd
504 sudo su -
505 psql -h 146.59.156.114 -p 5432 postgres postgres
506 sudo su -
507 sudo postgresql
508 sudo postgres
509 sudo - postgres
510 sudo su -
511 history
512 sudo systemctl status apache2.service
513 sudo systemctl start apache2.service
514 sudo vim /etc/apache2/conf-available/security.conf
515 cd /etc/apache2/sites-available
516 ls
517 sudo vim 01-www.secondsite.com.conf
518 sudo vim 01-www.logwire.org.conf
519 sudo htpasswd -c /etc/apache2/passwords Amadou
520 sudo systemctl restart apache2.service
521 sudo vim 01-www.logwire.org.conf
522 sudo vim 01-www.secondsite.com.conf
523 sudo vim 01-www.logwire.org.conf
524 sudo vim 01-www.secondsite.com.conf
525 sudo systemctl restart apache2.service
526 ls
527 cd /var/www/html/www.secondsite.com/top_secret/
528 ls
529 sudo vim index.html
530 sudo systemctl restart apache2.service
531 ls
532 sudo vim index.html
533 cd
534 cd /etc/apache2/sites-available/
535 ls -lrt
536 sudo vim 01-www.secondsite.com.conf
537 sudo vim 01-www.logwire.org.conf
538 sudo vim 01-www.secondsite.com.conf
539 sudo systemctl restart apache2.service
540 sudo systemctl restart apache2.service
541 sudo systemctl restart apache2.service
542 sudo systemctl status apache2.service
543 cd
544 sudo systemctl status apache2
545 sudo systemctl restart apache2.service
546 sudo systemctl status apache2.service
547 ss -lrtnp
548 sudo systemctl restart apache2.service
549 journalctl -xe
550 sudo systemctl restart apache2.service
551 sudo apt-get install apache2
552 sudo systemctl status apache2.service
553 sudo systemctl restart apache2.service
554 sudo systemctl status apache2.service
555 sudo systemctl status apache2.service
556 sudo systemctl start apache2.service
557 sudo systemctl restart apache2.service
558 journalctl -xe
559 sudo systemctl stop apache2.service
560 sudo systemctl status apache2.service
561 sudo systemctl restart apache2.service
562 sudo apt-get install apache2
563 sudo systemctl restart apache2.service
564 sudo systemctl status apache2.service
565 sudo systemctl restart apache2.service
566 systemctl status apache2.service
567 sudo systemctl start apache2.service
568 systemctl status apache2.service
569 sudo systemctl restart apache2.service
570 sudo apt update
571 sudo systemctl restart apache2.service
572 sudo apt install default
573 jdksudo apt install default
574 sudo apt install default-jdk
575 history
576 cd /opt/tomcat/bin/
577 ls
578 ls -lrt
579 cd ..
580 ls -lrt
581 cd conf
582 ls -lrt
583 sudo vim server.xml
584 sudo systemctl status apache2.service
585 sudo systemctl restart apache2.service
586 ls -lrt
587 sudo systemctl restart apache2.service
588 sudo vim server.xml cd
589 cd
590 cd /var/www/html/www.secondsite.com/top_secret/
591 ls
592 sudo vim index.html
593 cd ../../
594 ls
595 sudo vim index.html
596 sudo systemctl restart apache2.service
597 sudo systemctl start apache2.service
598 systemctl status apache2.service
599 journalctl -xe
600 systemctl status apache2.service
601 which lib
602 systemctl stop apache2.service
603 sudo systemctl status apache2.service
604 ps -aux
605 ps -aux |grep apache
606 ss -lrtnp
607 is-active apache-tomcat-9.0.65.tar.gz
608 is active apache-tomcat-9.0.65.tar.gz
609 activate apache-tomcat-9.0.65.tar.gz
610 ss -lrtnp
611 sudo systemctl restart apache2.service
612 history
613 clear
614 history
615 sudo systemctl restart apache2.service
616 systemctl status apache2.service
617 sudo systemctl restart apache2.service
618 sudo apt-get purge apache2
619 sudo apt-get install apache2
620 sudo systemctl status apache2.service
621 sudo systemctl restart apache2.service
622 cd /etc/apache2/sites-available/
623 ls
624 sudo vim 01-www.secondsite.com.conf
625 cd
626 ls
627 cd /var/www/html/www.secondsite.com/
628 ls
629 cd top_secret/
630 ls
631 sudo vim index.html
632 sudo systemctl restart apache2.service
633 cd
634 sudo a2enmod
635 sudo a2enmod ssl
636 sudo systemctl restart apache2.service
637 sudo
638 openssl req x509 nodes days 365 newkey rsa:2048 keyout / ssl private
/apache selfsigned.key out
639 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsign
640 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
641 -help
642 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
643 sudo nano /etc/apache2/sites
644 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
645 sudo apachectl configtest
646 sudo systemctl reload apache2.service
647 sudo systemctl restart apache2.service
648 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
649 sudo vim /etc/apache2/sites-available/01-www.logwire.org.conf
650 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
651 sudo systemctl restart apache2.service
652 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
653 sudo systemctl restart apache2.service
654 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
655 sudo openssl -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
656 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
657 history
658 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
659 history
660 sudo systemctl restart apache2.service
661 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
662 sudo vim /opt/tomcat/conf/tomcat-users.xml
663 sudo vim /opt/tomcat/conf
664 sudo vim /opt/tomcat/conf/
665 cd /opt/tomcat/conf/
666 ls -lrt
667 sudo vim logging.properties
668 sudo vim context.xml
669 sudo vim logging.properties
670 cd ..
671 ls -lrt
672 history
673 cd / | grep sentenv
674 ls
675 history | setenv
676 cd /opt/
677 ls
678 cd /opt/tomcat
679 ls
680 cd conf
681 ls
682 cd ..
683 ls
684 cd conf
685 ls
686 cd
687 ls
688 cd ..
689 ls
690 cd
691 cd /etc/
692 ls
693 cd systemd/system/
694 ls
695 cd
696 cd /opt/tomat/
697 cd
698 cd /opt/tomat/
699 cd /opt/tomcat/
700 ls
701 cd bin
702 ls
703 sudo vim setenv.sh
704 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
705 cd postgresql-tomcat/db
706 cp init.sql /home/ubuntu
707 sudo cp init.sql /home/ubuntu/
708 su -postgres
709 sudo su -postgres
710 su - postgres
711 sudo su - postgres
712 su postgres
713 sudo su postgres
714 \q
715 cd
716 exit
717 cd /opt/tomcat
718 ls
719 cd /opt/tomcat
720 cd conf/
721 ls
722 sudo vim server.xml
723 ls
724 cd bin
725 ls
726 sudo vim setenv.sh
727 cd /opt/systemd/
728 cd /etc/systemd/
729 cd system/
730 ls
731 sudo vim tomcat.service
732 cd
733 sudo vim /opt/tomcat/conf/tomcat-users.xml
734 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
735 cd postgresql-tomcat/db
736 cp init.sql /home/ubuntu
737 sudo cp init.sql /home/ubuntu
738 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
739 cd postgresql-tomcat/db
740 sudo cp init.sql /home/ubuntu
741 su -- postgres
742 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.gitcd
743 cd
744 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.gitcd
745 sudo systemctl restart postgresql
746 sudo systemctl restart tomcat.service
747 systemctl daemon-reload
748 sudo systemctl daemon-reload
749 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.gitcd
750 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
751 cd postgresql-tomcat/db
752 sudo cp init.sql /home/ubuntu
753 su - postgres
754 sudo su - postgres
755 sudo vim /etc/prometheus/prometheus.yml
756 dpkg -l apache2
757 cd /etc/apache2/
758 ls -lrt
759 cd conf-available/
760 ls -lrt
761 cd
762 find -Name "error.log"
763 find -name "error.log"
764 sudo find -name "error.log"
765 sudo find -name "access.log"
766 sudo find "access.log"
767 find "access.log"
768 sudo find "error.log"
769 sudo find -name "error.log"
770 sudo find -name / "error.log"
771 sudo find -name "error.log" /
772 cd /etc/apache2/
773 ls -lrt
774 sudo vim apache2.conf
775 sudo vim conf-available/
776 sudo vim envares
777 cd
778 cd /opt/tomcat/
779 ls -lrt
780 cd logs/
781 ls -lrt
782 cd catalina.out
783 sudo vim catalina.out
784 cd /opt/tomcat/
785 ls -lrt
786 cd conf/
787 ls -lrt
788 sudo vim server.xml
789 sudo vim catalina.p
790 sudo vim catalina
791 sudo vim tomcat-users.xml
792 sudo vim logging.properties
793 sudo vim context.xml
794 cd /etc/systemd/system/
795 ls -lrt
796 cd
797 cd /opt/tomcat/
798 ls -lrt
799 cd bin
800 ls -lrt
801 ./version.sh
802 cd
803 df -h
804 top
805 free -h
806 adduser oracle
807 sudo adduser oracle
808 id oracle
809 sudo su - oracle
810 sudo mkdir /opt/oracle
811 sudo unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip -d
/opt/oracle/
812 sudo vim ~/.profile
813 sudo chown oracle:oracle /opt/oracle
814 su - oracle
815 sudo chown oracle:oracle -R /opt/oracle/instantclient_19_8
816 sudo su - oracle
817 sudo su - oracle
818 sudo chown oracle:oracle -R /opt/oracle/instantclient_19_8
819 sudo su - oracle
820 history
821 sqlplus ot_admin/ot_password@L0CAL_PDB1
822 sudo su - oracle
823 sudo apt install ansible
824 ansible
825 versionansible
826 ansible --version
827 sudo adduser ansadmin
828 sudo nano /etc/
829 sudo vim /etc/sudoers
830 cd /etc/sudoers.d/
831 sudo cd /etc/sudoers.d/
832 cd /etc/sudoers.d/
833 sudo su -
834 sudo su - ansadmin
835 sudo su - ansadmin
836 ansible all -bm group -a "name=rennes"
837 ansible all -bm group -a "name=rennes"
838 sudo su - ansadmin
839 sudo su - ansadmin
840 ll
841 cd projetgit/
842 ll
843 ssh
844 ssh-keygen -t rsa
845 git clone [email protected]:logwire9/projet1.git
846 ssh-keygen -t rsa
847 cd
848 cat .ssh/id_rsa.pub
849 ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABgQDRXIB324zopABpaxXK8QQKhwMWlILiCpMOnWZMzM5zejf2I0+eGYNGY
rva+6LjnvcmZDUHKcS+19LeNewqk3o41xzSF6r2/FkKEc0xbu7bpY5Gyzxjh0XiDMVIFg3NjKBN17+9to5doS
GYnbBU53IFFEhFSBr3jg2+UzzSbmW76ZNlr7wu5kD/yoROkN7eRVmfjt4PtzwK3sg8gGEdhwDrgXlWkoYgw2B
joXtecnR27iXwFnFoMsr2By05GZ0Ap7lTdZVqsIAyBZyyAov2VJwzn/
4rEu8RPjBL8WtGr5PCImmv0flcWiEYKY7EvDHb3e+wI8t
0Bi+ExIU8ULifoOEYVXNH0mxM5RGVRFBrOFI654286qWe9PxYzioFJ/w8j0YqAtPKtA9E32zR9LN+cLtu7vUB
rhPDFjBSNxO/+/iUR0Ig+R4mvfYWgontuICBvDQ5vC6zx9E/
BvZsY21kopqh62KzqwsmJPe0benNsLMomNSMzh2zlKCIqJytSFIM
tKk= ofi03@svl200
850 cd projetgit/.
851 git clone [email protected]:logwire9/projet1.git
852 ll
853 cd projet1/
854 ll
855 sudo vim conflit.txt
856 sudo vim java.txt
857 git add .
858 git commit -m "ajout fichier java"
859 git push conflit.txt
860 git push
861 sudo vim java.txt
862 git add .
863 git commit -m "modif fichier java"
864 git push
865 git pull
866 sudo vim java.txt
867 git add .
868 git commit -m "modif fichier"
869 git push
870 git branch
871 git bra
872 git branch
873 git branch dev
874 git branch
875 git checkout dev
876 git branch
877 ll
878 git log --oneline
879 git push conflit.txt
880 sudo vim conflit.txt
881 git add .
882 git commit -m "modif fichier conflit"
883 git push
884 git push
885 git commit -m "modif fichier conflit"
886 git commit -m "modif fichier conflit.txt"
887 git log --oneline --graph --decorate -all
888 git dev --oneline --graph --decorate -all
889 git log --oneline --graph --decorate --all
890 git checkout master
891 git merge dev
892 git log --oneline --graph --decorate --all
893 git push
894 git log --oneline --graph --decorate --all
895 cd ../../
896 mkdir projetmerge
897 cd projetmerge/
898 git clone https://gitlab.com/logwire7/projet1.git
899 git branch
900 cd ..
901 cd projetgit/
902 mv ../projetmerge/ ..
903 mv ../projetmerge/ .
904 ll
905 cd projetmerge/
906 git branch
907 git clone https://gitlab.com/logwire7/projet1.git
908 git branch aaw
909 git branch
910 git checkout aaw
911 git branch
912 ll
913 sudo vim aaw.txt
914 git push origin aaw
915 ll
916 git branch
917 cd
918 cd projetgit/projet1/
919 ll
920 git
921 git branch aaw
922 git branch
923 git checkout aaw
924 ll
925 sudo vim index.html
926 git add .
927 git commit -m "modif index"
928 git push origin aaw
929 git push origin master
930 cd ..
931 cd projetmerge/
932 ll
933 sudo vim aaw.txt
934 ll
935 sudo vim index.html
936 git add .
937 git commit -m "modif index"
938 git push origin aaw
939 git branch
940 git branch aaw
941 git branch
942 git checkout aaw
943 git push origin aaw
944 git push origin master
945 git tag
946 ll
947 git log --oneline
948 git tag v1.2 45109db
949 git log --oneline
950 git tag v1.2 cea8cbf
951 git push origin v1.2
952 git tag v1.3 45109db
953 git push origin v1.3
954 sudo su - ansadmin
955 history
ofi03@svl200:~$ cd
.ansible/ .local/ Unix/
d1/ lien/ monappli/
snap/ tp1/
.cache/ .ssh/ am/
data/ lien_backup/ postgresql-tomcat/ system/
tp2/
.config/ Python/ backup/
hello.war/ list/ projetgit/
targz/
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ git --version
git version 2.25.1
ansadmin@svl200:~$ ll
total 280
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ./
drwxr-xr-x 11 root root 4096 Oct 3 08:32 ../
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 14:52 .ansible/
-rw------- 1 ansadmin ansadmin 34979 Oct 8 13:56 .bash_history
-rw-r--r-- 1 ansadmin ansadmin 220 Oct 3 08:32 .bash_logout
-rw-r--r-- 1 ansadmin ansadmin 3771 Oct 3 08:32 .bashrc
-rw-r--r-- 1 root root 12288 Oct 4 08:51 .exo4.yaml.swp
-rw------- 1 root root 12288 Oct 3 13:11 .handler.yaml.swp
-rw-r--r-- 1 ansadmin ansadmin 807 Oct 3 08:32 .profile
drwx------ 2 ansadmin ansadmin 4096 Oct 6 10:47 .ssh/
-rw------- 1 ansadmin ansadmin 8842 Oct 7 18:49 .viminfo
drwxr-xr-x 3 root root 4096 Oct 6 09:27 TP3/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:57 TPansible/
-rw-r--r-- 1 root root 0 Oct 3 10:12 cible1.txt
-rw-r--r-- 1 root root 173 Oct 4 12:29 copie.yaml
-rw-r--r-- 1 root root 261 Oct 5 11:29 debug.yaml
-rw-r--r-- 1 ansadmin ansadmin 277 Oct 3 17:57 debug1.yaml
-rw-r--r-- 1 root root 190 Oct 4 08:34 exo2.yaml
-rw-r--r-- 1 root root 175 Oct 4 08:44 exo3.yaml
-rw-r--r-- 1 root root 147 Oct 4 13:05 exo4.yaml
-rw-r--r-- 1 root root 247 Oct 3 14:37 fact.yaml
-rw-r--r-- 1 ansadmin ansadmin 179 Oct 3 14:46 fact1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 12:36 git/
-rw-r--r-- 1 root root 428 Oct 3 13:28 handler.yaml
-rw------- 1 ansadmin ansadmin 255 Oct 4 13:34 hello.yaml
-rw------- 1 ansadmin ansadmin 355 Oct 4 13:26 hello.yml
-rw-r--r-- 1 root root 24 Oct 3 13:38 index.html
-rw-r--r-- 1 root root 243 Oct 4 13:01 index.html.j2
-rw-r--r-- 1 ansadmin ansadmin 135 Oct 4 13:01 index.html1.j2
-rw-r--r-- 1 root root 0 Oct 3 14:40 ip.txt
-rw-r--r-- 1 ansadmin ansadmin 247 Oct 4 10:35 item_users.yaml
-rw-r--r-- 1 root root 244 Oct 4 10:20 items.yaml
-rw-r--r-- 1 root root 0 Oct 4 10:24 items_users.yaml
-rw-r--r-- 1 root root 235 Oct 4 10:08 list.yaml
-rw-r--r-- 1 root root 184 Oct 4 13:58 locale.yml
-rw-r--r-- 1 root root 224 Oct 3 12:31 nginx.yaml
-rw-r--r-- 1 root root 254 Oct 4 13:41 play-vars.yaml
-rw------- 1 ansadmin ansadmin 273 Oct 4 13:49 play-vars.yml
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 5 13:44 projet/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 13:14 projet1/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 6 07:29 projet2/
drwxrwxr-x 10 ansadmin ansadmin 4096 Oct 5 14:49 projet3/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 19:54 projet4/
-rw-r--r-- 1 root root 595 Oct 4 09:57 rep.yaml
-rw-r--r-- 1 ansadmin ansadmin 209 Oct 4 12:04 seq.yaml
-rw-r--r-- 1 root root 199 Oct 3 13:01 shell.yml
drwx------ 3 ansadmin ansadmin 4096 Oct 5 10:20 snap/
-rw-r--r-- 1 root root 228 Oct 4 13:14 template.yaml
-rw-r--r-- 1 ansadmin ansadmin 254 Oct 4 13:21 template1.yaml
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 20:56 tpansible/
-rw-r--r-- 1 root root 268 Oct 4 14:35 var_dic.yml
-rw-r--r-- 1 ansadmin ansadmin 280 Oct 4 15:12 var_dic2.yml
-rw-r--r-- 1 root root 337 Oct 5 14:04 var_dic_multi3.yml
-rw-r--r-- 1 ansadmin ansadmin 146 Oct 4 15:07 vars.yml
-rw-r--r-- 1 ansadmin ansadmin 149 Oct 5 10:26 vars2.yml
-rw-r--r-- 1 root root 237 Oct 5 08:08 vars_multi.yml
-rw-r--r-- 1 root root 304 Oct 3 17:58 when.yaml
-rw-r--r-- 1 root root 316 Oct 4 09:32 when1.yaml
ansadmin@svl200:~$
ansadmin@svl200:~$ ls -lrt projet
projet/ projet1/ projet2/ projet3/ projet4/
ansadmin@svl200:~$ ls -lrt projet
projet/ projet1/ projet2/ projet3/ projet4/
ansadmin@svl200:~$ ls -lrt projet
projet/ projet1/ projet2/ projet3/ projet4/
ansadmin@svl200:~$ ls -lrt projet
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ git init
Initialized empty Git repository in /home/ansadmin/tpansible/.git/
ansadmin@svl200:~/tpansible$ ll
total 32
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 8 15:00 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 7 18:57 ../
drwxrwxr-x 7 ansadmin ansadmin 4096 Oct 8 15:00 .git/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ ls -lrt .git/
total 32
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 8 15:00 branches
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 8 15:00 refs
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 8 15:00 info
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 8 15:00 hooks
-rw-rw-r-- 1 ansadmin ansadmin 73 Oct 8 15:00 description
-rw-rw-r-- 1 ansadmin ansadmin 23 Oct 8 15:00 HEAD
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 8 15:00 objects
-rw-rw-r-- 1 ansadmin ansadmin 92 Oct 8 15:00 config
ansadmin@svl200:~/tpansible$ git config --global user.name "aaw"
ansadmin@svl200:~/tpansible$ git config --global user.email "[email protected]"
ansadmin@svl200:~/tpansible$ ll
total 32
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 8 15:00 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 8 15:03 ../
drwxrwxr-x 7 ansadmin ansadmin 4096 Oct 8 15:00 .git/
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
group_vars/
hosts.yml
psql.yml
roles/
nothing added to commit but untracked files present (use "git add" to track)
ansadmin@svl200:~/tpansible$ git ls-tree -r HEAD
fatal: Not a valid object name HEAD
ansadmin@svl200:~/tpansible$ touch fichier.txt
ansadmin@svl200:~/tpansible$ git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
fichier.txt
group_vars/
hosts.yml
psql.yml
roles/
nothing added to commit but untracked files present (use "git add" to track)
ansadmin@svl200:~/tpansible$ git add fichier.txt
ansadmin@svl200:~/tpansible$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: fichier.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
group_vars/
hosts.yml
psql.yml
roles/
nothing added to commit but untracked files present (use "git add" to track)
ansadmin@svl200:~/tpansible$ git ls-tree -r HEAD
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 fichier.txt
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ll
total 32
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 8 15:11 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 8 15:03 ../
drwxrwxr-x 8 ansadmin ansadmin 4096 Oct 8 15:13 .git/
-rw-rw-r-- 1 ansadmin ansadmin 0 Oct 8 15:11 fichier.txt
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ tree
.
├── fichier.txt
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
12 directories, 13 files
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ll
total 32
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 8 15:11 ./
drwxr-xr-x 14 ansadmin ansadmin 4096 Oct 8 15:03 ../
drwxrwxr-x 8 ansadmin ansadmin 4096 Oct 8 15:13 .git/
-rw-rw-r-- 1 ansadmin ansadmin 0 Oct 8 15:11 fichier.txt
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ mkdir ../progetgit
ansadmin@svl200:~/tpansible$ mv .git/ ../progetgit/
ansadmin@svl200:~/tpansible$ ll
total 28
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 8 15:28 ./
drwxr-xr-x 15 ansadmin ansadmin 4096 Oct 8 15:27 ../
-rw-rw-r-- 1 ansadmin ansadmin 0 Oct 8 15:11 fichier.txt
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ cd ../
ansadmin@svl200:~$ ll
total 288
drwxr-xr-x 15 ansadmin ansadmin 4096 Oct 8 15:27 ./
drwxr-xr-x 11 root root 4096 Oct 3 08:32 ../
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 14:52 .ansible/
-rw------- 1 ansadmin ansadmin 34979 Oct 8 13:56 .bash_history
-rw-r--r-- 1 ansadmin ansadmin 220 Oct 3 08:32 .bash_logout
-rw-r--r-- 1 ansadmin ansadmin 3771 Oct 3 08:32 .bashrc
-rw-r--r-- 1 root root 12288 Oct 4 08:51 .exo4.yaml.swp
-rw-rw-r-- 1 ansadmin ansadmin 52 Oct 8 15:03 .gitconfig
-rw------- 1 root root 12288 Oct 3 13:11 .handler.yaml.swp
-rw-r--r-- 1 ansadmin ansadmin 807 Oct 3 08:32 .profile
drwx------ 2 ansadmin ansadmin 4096 Oct 6 10:47 .ssh/
-rw------- 1 ansadmin ansadmin 8842 Oct 7 18:49 .viminfo
drwxr-xr-x 3 root root 4096 Oct 6 09:27 TP3/
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 7 18:57 TPansible/
-rw-r--r-- 1 root root 0 Oct 3 10:12 cible1.txt
-rw-r--r-- 1 root root 173 Oct 4 12:29 copie.yaml
-rw-r--r-- 1 root root 261 Oct 5 11:29 debug.yaml
-rw-r--r-- 1 ansadmin ansadmin 277 Oct 3 17:57 debug1.yaml
-rw-r--r-- 1 root root 190 Oct 4 08:34 exo2.yaml
-rw-r--r-- 1 root root 175 Oct 4 08:44 exo3.yaml
-rw-r--r-- 1 root root 147 Oct 4 13:05 exo4.yaml
-rw-r--r-- 1 root root 247 Oct 3 14:37 fact.yaml
-rw-r--r-- 1 ansadmin ansadmin 179 Oct 3 14:46 fact1.yaml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 12:36 git/
-rw-r--r-- 1 root root 428 Oct 3 13:28 handler.yaml
-rw------- 1 ansadmin ansadmin 255 Oct 4 13:34 hello.yaml
-rw------- 1 ansadmin ansadmin 355 Oct 4 13:26 hello.yml
-rw-r--r-- 1 root root 24 Oct 3 13:38 index.html
-rw-r--r-- 1 root root 243 Oct 4 13:01 index.html.j2
-rw-r--r-- 1 ansadmin ansadmin 135 Oct 4 13:01 index.html1.j2
-rw-r--r-- 1 root root 0 Oct 3 14:40 ip.txt
-rw-r--r-- 1 ansadmin ansadmin 247 Oct 4 10:35 item_users.yaml
-rw-r--r-- 1 root root 244 Oct 4 10:20 items.yaml
-rw-r--r-- 1 root root 0 Oct 4 10:24 items_users.yaml
-rw-r--r-- 1 root root 235 Oct 4 10:08 list.yaml
-rw-r--r-- 1 root root 184 Oct 4 13:58 locale.yml
-rw-r--r-- 1 root root 224 Oct 3 12:31 nginx.yaml
-rw-r--r-- 1 root root 254 Oct 4 13:41 play-vars.yaml
-rw------- 1 ansadmin ansadmin 273 Oct 4 13:49 play-vars.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 8 15:28 progetgit/
drwxrwxr-x 4 ansadmin ansadmin 4096 Oct 5 13:44 projet/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 5 13:14 projet1/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 6 07:29 projet2/
drwxrwxr-x 10 ansadmin ansadmin 4096 Oct 5 14:49 projet3/
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 7 19:54 projet4/
-rw-r--r-- 1 root root 595 Oct 4 09:57 rep.yaml
-rw-r--r-- 1 ansadmin ansadmin 209 Oct 4 12:04 seq.yaml
-rw-r--r-- 1 root root 199 Oct 3 13:01 shell.yml
drwx------ 3 ansadmin ansadmin 4096 Oct 5 10:20 snap/
-rw-r--r-- 1 root root 228 Oct 4 13:14 template.yaml
-rw-r--r-- 1 ansadmin ansadmin 254 Oct 4 13:21 template1.yaml
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 8 15:28 tpansible/
-rw-r--r-- 1 root root 268 Oct 4 14:35 var_dic.yml
-rw-r--r-- 1 ansadmin ansadmin 280 Oct 4 15:12 var_dic2.yml
-rw-r--r-- 1 root root 337 Oct 5 14:04 var_dic_multi3.yml
-rw-r--r-- 1 ansadmin ansadmin 146 Oct 4 15:07 vars.yml
-rw-r--r-- 1 ansadmin ansadmin 149 Oct 5 10:26 vars2.yml
-rw-r--r-- 1 root root 237 Oct 5 08:08 vars_multi.yml
-rw-r--r-- 1 root root 304 Oct 3 17:58 when.yaml
-rw-r--r-- 1 root root 316 Oct 4 09:32 when1.yaml
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ ll
total 28
drwxrwxr-x 5 ansadmin ansadmin 4096 Oct 8 15:28 ./
drwxr-xr-x 15 ansadmin ansadmin 4096 Oct 8 15:27 ../
-rw-rw-r-- 1 ansadmin ansadmin 0 Oct 8 15:11 fichier.txt
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ git ls-tree -r HEAD
fatal: not a git repository (or any of the parent directories): .git
ansadmin@svl200:~/tpansible$ git status
fatal: not a git repository (or any of the parent directories): .git
ansadmin@svl200:~/tpansible$ mv ../progetgit/.git/ .
ansadmin@svl200:~/tpansible$ ll
total 32
drwxrwxr-x 6 ansadmin ansadmin 4096 Oct 8 15:30 ./
drwxr-xr-x 15 ansadmin ansadmin 4096 Oct 8 15:27 ../
drwxrwxr-x 8 ansadmin ansadmin 4096 Oct 8 15:13 .git/
-rw-rw-r-- 1 ansadmin ansadmin 0 Oct 8 15:11 fichier.txt
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars/
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars/
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles/
ansadmin@svl200:~/tpansible$ exit
logout
ofi03@svl200:~$ ll
total 160100
drwxr-xr-x 23 ofi03 ofi03 4096 Oct 8 10:41 ./
drwxr-xr-x 11 root root 4096 Oct 3 08:32 ../
-rw------- 1 ofi03 ofi03 364 Oct 8 10:41 .Xauthority
drwx------ 4 ofi03 ofi03 4096 Oct 4 07:55 .ansible/
-rw------- 1 ofi03 ofi03 19067 Oct 8 01:04 .bash_history
-rw-r--r-- 1 ofi03 ofi03 220 Aug 31 06:36 .bash_logout
-rw-r--r-- 1 ofi03 ofi03 3771 Sep 2 08:39 .bashrc
drwx------ 2 ofi03 ofi03 4096 Aug 31 08:04 .cache/
drwx------ 3 ofi03 ofi03 4096 Aug 31 10:10 .config/
-rw-rw-r-- 1 ofi03 ofi03 51 Oct 7 08:48 .gitconfig
drwxrwxr-x 3 ofi03 ofi03 4096 Sep 1 14:35 .local/
-rw-r--r-- 1 ofi03 ofi03 932 Sep 30 09:14 .profile
-rw-rw-r-- 1 ofi03 ofi03 66 Sep 1 14:35 .selected_editor
drwx------ 2 ofi03 ofi03 4096 Oct 7 12:51 .ssh/
-rw-r--r-- 1 ofi03 ofi03 0 Aug 31 10:12 .sudo_as_admin_successful
-rw------- 1 ofi03 ofi03 19513 Oct 7 10:16 .viminfo
drwxrwxr-x 3 exp2 ofi03 4096 Sep 5 13:32 Python/
drwxrwxr-x 4 ofi03 ofi03 4096 Sep 5 12:02 Unix/
-rw-rw-r-- 1 ofi03 ofi03 192 Sep 5 13:29 Unix.tar.gz
drwxrwxr-x 2 ofi03 ofi03 4096 Sep 7 14:16 am/
-rw-rw-r-- 1 ofi03 ofi03 21 Sep 4 21:44 am.txt
-rw-rw-r-- 1 ofi03 ofi03 11593900 Jul 14 13:13 apache-tomcat-9.0.65.tar.gz
drwxrw-rw- 3 root ofi03 4096 Aug 31 12:05 backup/
drwxrwxr-x 8 ofi03 ofi03 4096 Sep 5 21:25 d1/
drwxrwxr-x 2 ofi03 ofi03 4096 Sep 2 09:47 data/
-rw-rw-r-- 1 ofi03 ofi03 198 Oct 6 12:49 dump.sql
-rw------- 1 ofi03 ofi03 41858954 Sep 8 08:17 dump1.hprof
-rw-rw-r-- 1 ofi03 ofi03 138 Aug 31 12:39 etudiant.txt
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 5 12:26 exo1
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 5 12:26 exo2
-rw------- 1 ofi03 ofi03 33635764 Sep 8 09:32 heapdump.hprof
drwxr-xr-x 7 ofi03 ofi03 4096 Sep 7 12:48 hello.war/
-rw-rw-r-- 1 ofi03 ofi03 75570057 Sep 30 09:11 instantclient-basic-linux.x64-
19.8.0.0.0dbru.zip
-rw-rw-r-- 1 ofi03 ofi03 911254 Sep 30 09:12 instantclient-sqlplus-linux.x64-
19.8.0.0.0dbru.z
ip
lrwxrwxrwx 1 ofi03 ofi03 4 Sep 4 13:05 lien -> tp1//
lrwxrwxrwx 1 ofi03 ofi03 7 Aug 31 12:01 lien_backup -> backup//
drwxrwxr-x 4 ofi03 ofi03 4096 Aug 31 09:58 list/
drwxrwxr-x 2 ofi03 ofi03 4096 Sep 7 13:44 monappli/
-rw------- 1 root root 34 Sep 12 01:06 nano.save
-rw------- 1 root root 34 Sep 12 01:06 nano.save.1
-rw------- 1 root root 9 Oct 3 15:25 nano.save.2
-rw------- 1 root root 8 Oct 3 15:25 nano.save.3
-rw-rw-r-- 1 ofi03 ofi03 36 Aug 31 12:45 nom.txt
-rw-rw-r-- 1 ofi03 ofi03 36 Sep 1 15:42 nom1.txt
drwxrwxr-x 6 ofi03 ofi03 4096 Sep 12 23:37 postgresql-tomcat/
-rw-rw-r-- 1 ofi03 ofi03 10240 Aug 31 13:40 profile.tar
-rw-rw-r-- 1 ofi03 ofi03 1556 Aug 31 13:47 profile.tar.bz2
-rw-rw-r-- 1 ofi03 ofi03 1612 Aug 31 13:46 profile.tar.xz
drwxrwxr-x 5 ofi03 ofi03 4096 Oct 7 13:54 projetgit/
-rw-rw-r-- 1 ofi03 ofi03 1317 Oct 6 12:49 psql.yml
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 4 21:44 resultat.txt
-rw-rw-r-- 1 ofi03 ofi03 4606 Sep 7 13:18 sample.war
-rwxrwxr-x 1 ofi03 ofi03 43 Sep 2 07:56 script0.sh*
-rwxrwxr-x 1 ofi03 ofi03 196 Sep 2 08:21 script1.sh*
-rwxrwxr-x 1 ofi03 ofi03 110 Sep 2 10:29 script10.sh*
-rwxrwxr-x 1 ofi03 ofi03 106 Sep 2 12:08 script11.sh*
-rwxrwxr-x 1 ofi03 ofi03 111 Sep 2 12:22 script12.sh*
-rwxrwxr-x 1 ofi03 ofi03 106 Sep 2 12:27 script13.sh*
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 2 12:40 script14
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 2 12:38 script14.sh
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 2 13:27 script15.sh
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 2 13:28 script17.sh
-rwxrwxr-x 1 ofi03 ofi03 66 Sep 2 13:07 script18.sh*
-rwxrwxr-x 1 ofi03 ofi03 102 Sep 2 13:16 script19.sh*
-rw-rw-r-- 1 ofi03 ofi03 67 Sep 2 08:29 script2.sh
-rwxrwxr-x 1 ofi03 ofi03 94 Sep 2 13:26 script20.sh*
-rwxrwxr-x 1 ofi03 ofi03 128 Sep 2 13:37 script21.sh*
-rwxrwxr-x 1 ofi03 ofi03 162 Sep 2 13:50 script22.sh*
-rwxrwxr-x 1 ofi03 ofi03 220 Sep 2 14:05 script23.sh*
-rwxrwxr-x 1 ofi03 ofi03 195 Sep 2 09:03 script3.sh*
-rwxrwxr-x 1 ofi03 ofi03 104 Sep 2 09:34 script4.sh*
-rwxrwxr-x 1 ofi03 ofi03 48 Sep 2 09:45 script5.sh*
-rwxrwxr-x 1 ofi03 ofi03 91 Sep 2 10:14 script6.sh*
-rwxrwxr-x 1 ofi03 ofi03 106 Sep 2 10:13 script7.sh*
-rwxrwxr-x 1 ofi03 ofi03 135 Sep 2 10:23 script8.sh*
-rwxrwxr-x 1 ofi03 ofi03 110 Sep 2 10:25 script9.sh*
-rw-rw-r-- 1 ofi03 ofi03 94 Sep 4 21:38 sed.txt
drwx------ 3 ofi03 ofi03 4096 Sep 5 12:20 snap/
drw------- 2 ofi03 ofi03 4096 Aug 31 09:35 system/
-rwxr-xr-x 1 ofi03 ofi03 2738 Aug 31 09:41 system.log*
-rw-rw-r-- 1 ofi03 ofi03 10240 Aug 31 13:38 system.tar
-rw-rw-r-- 1 ofi03 ofi03 208 Sep 5 13:24 system.tar.bz2
-rw-rw-r-- 1 ofi03 ofi03 192 Sep 5 13:22 system.tar.gz
-rw-rw-r-- 1 ofi03 ofi03 228 Sep 5 13:23 system.tar.xz
drwxrwxr-x 2 ofi03 ofi03 4096 Sep 2 13:29 targz/
-rw-r--r-- 1 root root 0 Sep 1 09:31 test.log
-rw-rw-r-- 1 ofi03 ofi03 0 Sep 1 15:20 test_ssh.log
drwxrwxr-x 2 ofi03 ofi03 4096 Sep 4 13:06 tp1/
drwxrwxr-x 3 ofi03 ofi03 4096 Sep 2 15:42 tp2/
-rw------- 1 ofi03 ofi03 2602 Sep 5 15:54 yes
-rw-r--r-- 1 ofi03 ofi03 566 Sep 5 15:54 yes.pub
-rw-rw-r-- 1 ofi03 ofi03 1543 Aug 31 13:52 {profile.tar.gz_old}
ofi03@svl200:~$ cd projetgit/
ofi03@svl200:~/projetgit$ ll
total 32
drwxrwxr-x 5 ofi03 ofi03 4096 Oct 7 13:54 ./
drwxr-xr-x 23 ofi03 ofi03 4096 Oct 8 10:41 ../
drwxrwxr-x 8 ofi03 ofi03 4096 Oct 7 13:58 .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 84 Oct 7 10:16 index.html
-rw------- 1 ofi03 ofi03 1 Oct 7 12:30 nano.save
drwxrwxr-x 3 ofi03 ofi03 4096 Oct 7 14:08 projet1/
drwxrwxr-x 3 ofi03 ofi03 4096 Oct 7 14:13 projetmerge/
-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$ cd
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ git clone [email protected]:logwire9/role_psql.git
Cloning into 'role_psql'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Untracked files:
(use "git add <file>..." to include in what will be committed)
group_vars/
hosts.yml
psql.yml
role_psql/
roles/
no changes added to commit (use "git add" and/or "git commit -a")
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ git add
Nothing specified, nothing added.
Maybe you wanted to say 'git add .'?
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ls -lrt
total 24
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 8 16:07 role_psql
ansadmin@svl200:~/tpansible$ cd role_psql/
ansadmin@svl200:~/tpansible/role_psql$ ls
ansadmin@svl200:~/tpansible/role_psql$ rm -r ../role_psql/
ansadmin@svl200:~/tpansible/role_psql$ cd ..
ansadmin@svl200:~/tpansible$ ls -lrt
total 20
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
ansadmin@svl200:~/tpansible$ git clone [email protected]:logwire9/role_psql.git
Cloning into 'role_psql'...
warning: You appear to have cloned an empty repository.
ansadmin@svl200:~/tpansible$ ls -lrt
total 24
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 8 16:25 role_psql
ansadmin@svl200:~/tpansible$ git add .
error: 'role_psql/' does not have a commit checked out
fatal: adding files failed
ansadmin@svl200:~/tpansible$ rm -r role_psql/
ansadmin@svl200:~/tpansible$ ls -lrt
total 20
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 7 20:56 psql.yml
ansadmin@svl200:~/tpansible$ git
ansadmin@svl200:~/tpansible$ git add .
ansadmin@svl200:~/tpansible$ git commit -m "mon pojet psql"
[master 5cda2ec] mon pojet psql
13 files changed, 199 insertions(+)
delete mode 100644 fichier.txt
create mode 100644 group_vars/all.yml
create mode 100644 hosts.yml
create mode 100644 psql.yml
create mode 100644 roles/postgres/README.md
create mode 100644 roles/postgres/defaults/main.yml
create mode 100644 roles/postgres/handlers/main.yml
create mode 100644 roles/postgres/meta/main.yml
create mode 100644 roles/postgres/tasks/main.yml
create mode 100644 roles/postgres/templates/index.html.j2
create mode 100644 roles/postgres/tests/inventory
create mode 100644 roles/postgres/tests/test.yml
create mode 100644 roles/postgres/vars/main.yml
ansadmin@svl200:~/tpansible$ git remote -v
ansadmin@svl200:~/tpansible$ git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ git clone [email protected]:logwire9/role_psql.git
Cloning into 'role_psql'...
warning: You appear to have cloned an empty repository.
ansadmin@svl200:~/tpansible$ exit
logout
ofi03@svl200:~$ ls
Python dump1.hprof
list profile.tar.bz2 script12.sh script21.sh
sed.txt test_ssh.log
Unix etudiant.txt
monappli profile.tar.xz script13.sh script22.sh snap
tp1
Unix.tar.gz exo1
nano.save projetgit script14 script23.sh
system tp2
am exo2
nano.save.1 psql.yml script14.sh script3.sh
system.log yes
am.txt heapdump.hprof
nano.save.2 resultat.txt script15.sh script4.sh
system.tar yes.pub
apache-tomcat-9.0.65.tar.gz hello.war
nano.save.3 sample.war script17.sh script5.sh
system.tar.bz2 {profile.tar.gz_old}
backup instantclient-basic-linux.x64-
19.8.0.0.0dbru.zip nom.txt script0.sh
script18.sh script6.sh system.tar.gz
d1 instantclient-sqlplus-
linux.x64-19.8.0.0.0dbru.zip nom1.txt script1.sh
script19.sh script7.sh system.tar.xz
data lien
postgresql-tomcat script10.sh script2.sh script8.sh targz
dump.sql lien_backup
profile.tar script11.sh script20.sh script9.sh
test.log
ofi03@svl200:~$ cd projetgit/
ofi03@svl200:~/projetgit$ ls
fichier.html index.html nano.save projet1 projetmerge readme.md
tuto.pdf
ofi03@svl200:~/projetgit$ ls
fichier.html index.html nano.save projet1 projetmerge readme.md
tuto.pdf
ofi03@svl200:~/projetgit$ ls -lrt
total 16
-rw-rw-r-- 1 ofi03 ofi03 0 Oct 7 08:50 fichier.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
-rw-rw-r-- 1 ofi03 ofi03 84 Oct 7 10:16 index.html
-rw------- 1 ofi03 ofi03 1 Oct 7 12:30 nano.save
drwxrwxr-x 3 ofi03 ofi03 4096 Oct 7 14:08 projet1
drwxrwxr-x 3 ofi03 ofi03 4096 Oct 7 14:13 projetmerge
ofi03@svl200:~/projetgit$ cd
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ ls -lrt
total 24
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 7 19:04 roles
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 19:13 hosts_vars
drwxrwxr-x 2 ansadmin ansadmin 4096 Oct 7 20:53 group_vars
-rw-r--r-- 1 ansadmin ansadmin 118 Oct 7 20:55 hosts.yml
-rw-r--r-- 1 ansadmin ansadmin 87 Oct 8 16:43 psql.yml
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 8 16:53 role_psql
ansadmin@svl200:~/tpansible$ cd role_psql/
ansadmin@svl200:~/tpansible/role_psql$ git clone
[email protected]:logwire9/role_psql.git
Cloning into 'role_psql'...
warning: You appear to have cloned an empty repository.
ansadmin@svl200:~/tpansible/role_psql$
ansadmin@svl200:~/tpansible/role_psql$ ls -lrt
total 4
drwxrwxr-x 3 ansadmin ansadmin 4096 Oct 8 16:56 role_psql
ansadmin@svl200:~/tpansible/role_psql$ rm -r role_psql/
ansadmin@svl200:~/tpansible/role_psql$ ls
ansadmin@svl200:~/tpansible/role_psql$ git add .
ansadmin@svl200:~/tpansible/role_psql$ git commit -m "mon pojet psql"
On branch master
Initial commit
PLAY RECAP
*************************************************************************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 resc
ued=0 ignored=0
all
children:
^ here
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml hosts.yml
PLAY RECAP
*************************************************************************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 resc
ued=0 ignored=0
all:i
children:
^ here
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml hosts.yml
PLAY RECAP
*************************************************************************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 resc
ued=0 ignored=0
all:
^ here
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml hosts_vars
ERROR! the playbook: hosts_vars does not appear to be a file
ansadmin@svl200:~/tpansible$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
23 directories, 24 files
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/
README.md files/ meta/ templates/ vars/
defaults/ handlers/ tasks/ tests/
ansadmin@svl200:~/tpansible$ sudo vim roles/postgres/tasks/main.yml
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
├── role_postgres
│ ├── group_vars
│ │ └── all.yml
│ ├── hosts.yml
│ ├── psql.yml
│ └── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
23 directories, 24 files
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ mv roles/ ../
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── role_postgres
├── group_vars
│ └── all.yml
├── hosts.yml
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
13 directories, 15 files
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
└── role_postgres
├── group_vars
│ └── all.yml
├── hosts.yml
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
13 directories, 15 files
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres
ansadmin@svl200:~/tpansible$ mv group_vars/ hosts.yml hosts_vars/ psql.yml ../
ansadmin@svl200:~/tpansible$ tree
.
└── role_postgres
├── group_vars
│ └── all.yml
├── hosts.yml
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
11 directories, 12 files
ansadmin@svl200:~/tpansible$ tree
.
└── role_postgres
├── group_vars
│ └── all.yml
├── hosts.yml
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
11 directories, 12 files
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
ERROR! the playbook: psql.yml could not be found
ansadmin@svl200:~/tpansible$ mv ../group_vars/ ../hosts.yml ../hosts_vars/
../psql.yml .
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
ERROR! the role 'postgres' was not found in
/home/ansadmin/tpansible/roles:/home/ansadmin/.ansible/roles:/usr/share/ansible/
roles:/etc/ansible/roles:/home/ansadmin/tpansible
roles:
- postgres
^ here
ansadmin@svl200:~/tpansible$ mv ../roles/ .
ansadmin@svl200:~/tpansible$ ansible-playbook psql.yml
PLAY RECAP
*************************************************************************************
*************************************************************************************
************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
├── role_postgres
│ ├── group_vars
│ │ └── all.yml
│ ├── hosts.yml
│ ├── psql.yml
│ └── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
23 directories, 24 files
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ cd role_postgres/
ansadmin@svl200:~/tpansible/role_postgres$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── psql.yml
└── roles
└── postgres
├── README.md
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
10 directories, 12 files
ansadmin@svl200:~/tpansible/role_postgres$ ansible-playbook psql.yml
PLAY RECAP
*************************************************************************************
*************************************************************************************
************************
146.59.158.16 : ok=13 changed=5 unreachable=0
failed=0 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible/role_postgres$
ansadmin@svl200:~/tpansible/role_postgres$ ls
group_vars hosts.yml psql.yml roles
ansadmin@svl200:~/tpansible/role_postgres$ roles
ansadmin@svl200:~/tpansible/role_postgres$ cd roles/
ansadmin@svl200:~/tpansible/role_postgres/roles$ l
postgres/
ansadmin@svl200:~/tpansible/role_postgres/roles$ ls
postgres
ansadmin@svl200:~/tpansible/role_postgres/roles$ exit
logout
ofi03@svl200:~$ history
1 clear
2 usermod -aG sudo etl3
3 su - etl
4 clear
5 sudo su -
6 ls -lrt
7 chmod u=rw,g=rw,o=r system.log
8 ls -lrt
9 clear
10 ls -lrt
11 chmod 777 system.log
12 ls -lrt
13 chmod u=rw,g=rw,o=r system.log
14 clear
15 ls -lrt
16 chmod a+rw system.log
17 ls -lrt
18 clear
19 chmod 755 -R system.log
20 ls -lrt
21 cd
22 cd profile/
23 cd
24 sudo touch test.log
25 ls -lrt
26 clear
27 sudo systemctl start cron.service
28 sudo systemctl is-active cron.service
29 sudo systemctl stop cron.service
30 sudo systemctl is-active cron.service
31 sudo systemctl restart cron.service
32 sudo systemctl is-active cron.service
33 sudo systemctl -t help
34 sudo systemctl list-init-files -t init services
35 sudo systemctl list-init-files -t init service
36 sudo systemctl list-init-files -t service
37 sudo systemctl list-init-file -t service
38 clear
39 sudo systemctl list-unit-files -t service
40 clear
41 sudo systemctl list-unit -t service
42 sudo systemctl list-units -t service
43 clear
44 sudo dpkg --get -selections
45 sudo dpkg --get -selection
46 sudo dpkg --get-selections
47 sudo dpkg --get-selections | grep vim
48 sudo dpkg --get-selections | grep ucf
49 sudo dpkg -l cron
50 sudo dpkg -l cron |grep ii
51 sudo dpkg -l cron |grep ixgh
52 sudo dpkg -r cron
53 clear
54 sudo apt update
55 sudo get install zip
56 sudo apt install zip
57 sudo dpkg --get-selections zip
58 sudo dpkg --get-selections
59 sudo dpkg --get-selections | grep zip
60 clear
61 sudo apt update
62 apt list --upgradable
63 sudo apt upgrade
64 sudo apt update
65 cat /etc/apt/source.lists
66 cat /etc/apt/source.list
67 cat /etc/apt/sources.list
68 sudo apt-cache search apache2
69 sudo apt-cache show apache2
70 sudo apt-cache find apache2
71 sudo apt-cache print apache2
72 sudo apt-cache view apache2
73 sudo apt-cache depends apache2
74 sudo apt-cache rdepends apache2
75 clear
76 crontab -e
77 clear
78 crontab -e
79 clear
80 crontab -e
81 clear
82 crontab -e
83 clear
84 crontab -
85 clear
86 crontab -e
87 clear
88 crontab -e
89 cd
90 ls
91 clear
92 ls
93 crontab -e
94 clear
95 rm crontab -e
96 clear
97 sudo crontab -e
98 clear
99 vim a1.sh
100 cd
101 ls
102 cd /etc/cloud/templates/
103 ll
104 cd ..
105 ll
106 cd
107 cd /etc/cloud/templates/
108 ll
109 xclock
110 cd
111 xclock
112 exit
113 cd
114 pwd
115 mkdir Unix Python
116 ls
117 mkdir Unix/TP1 Unix/TP2
118 cd Unix
119 ls
120 mkdir Python/TP1 Python/TP2
121 cd
122 mkdir Python/TP1 Python/TP2
123 cd Python
124 ls
125 rm -r TP1 TP2
126 ls
127 cd
128 cd Unix
129 ls
130 cp TP1 TP2 /Python
131 cp TP1 TP2 ./Python
132 cd
133 cd Unix
134 ls
135 cp TP1 TP2 ../Python
136 cp -r TP1 TP2 ../Python
137 cd
138 cd Python
139 ls
140 mkdir cd
141 cd
142 mkdir -r seance1 seance2 /Unix/TP1/
143 mkdir /Unix/TP1/seance1 /Unix/TP1/seance2
144 mkdir -p /Unix/TP1/seance1 /Unix/TP1/seance2
145 cd
146 cd Unix
147 cd TP1
148 ls
149 mkdir seance1 seance2
150 ls
151 cd
152 ls-lrt
153 ls -lrt Python
154 rmdir cd
155 cdPython
156 cd Python
157 rmdir cd
158 ls -lrt Pyton
159 ls -lrt Python
160 ls
161 tree
162 sudo snap install tree
163 cd
164 tree
165 touch /Unix/TP1/seance1/exo{1,2}
166 cd /Unix/TP1/seance
167 cd /Unix/TP1/seance1
168 cd
169 ls
170 cd Unix
171 ls
172 cd TP1
173 ls
174 cd seance1
175 touch exo{1,2}
176 cd
177 cd Python
178 ls
179 cd
180 cd TP2
181 touch exo{1,2}
182 tree
183 cd /Python/TP2
184 cd Python/TP2
185 ls
186 touch exo{1,2}
187 ls
188 tree
189 cd
190 tree
191 cd
192 tree
193 cd Python/TP1
194 ls
195 cd ../Unix/TP2
196 cd ./Unix/TP2
197 cd
198 cd Python/TP1
199 ls
200 cd /Unix/TP2
201 cd ./Unix/TP2
202 cd ../../Unix/TP2
203 cd
204 cd Python
205 cd TP1
206 rmdir TP1
207 rmdir -r TP1
208 ls
209 rmdir ../TP1
210 cd
211 cd Python
212 ls
213 cd
214 rmdir Python/TP2
215 cd Python
216 ls
217 rmdir TP2
218 rm -r TP2
219 Tree
220 cd
221 Tree
222 tree
223 cd Python
224 ls
225 cd
226 cd Unix/TP1
227 ls
228 mv Unix/TP1/seance1/exo1 Unix/TP1/exo1
229 mv Unix/TP1/seance1/exo1 Unix/TP1
230 cd
231 cd Unix
232 ls
233 cd TP1
234 ls
235 cd seance1
236 ls
237 mv exo1 ../../TP1
238 cd ../../
239 ls
240 cd TP1
241 ls
242 cd
243 rm -R Unix/TP1/seance1 Unix/TP1/ex1
244 rm -R Unix/TP1/seance1 Unix/TP1/exo1
245 cd Unix
246 ls
247 cd TP1
248 ls
249 tree
250 cd
251 tree
252 cd Pyhton/TP1
253 cd Python/TP1
254 cd Python
255 cd Python/TP1/
256 cd
257 cd Python/TP1
258 cd Python/TP1/
259 cd Python
260 ls
261 cd Unix/TP1
262 cd Unix
263 cd
264 cd Unix
265 ls
266 cd TP2
267 ls
268 cd TP1
269 cd ../
270 cd
271 ls
272 cd Unix
273 ls
274 cd TP2
275 ls
276 cd ../
277 cd TP1
278 ls
279 rm -r seance2
280 ls
281 trecd
282 tree
283 *tree
284 tree
285 cd
286 tree
287 cd Python/Unix
288 cd Python/Unix/
289 cd Unix/TP1
290 ls
291 touch exo{1,2}
292 ls
293 cd
294 tree
295 sudo su -
296 l
297 cd Unix/TP1
298 ls-lrt
299 cd
300 cd Unix
301 ls -lrt
302 sudo chown Exp1 TP1
303 chown Exp1 TP1
304 sudo chown Exp1 TP1
305 cd
306 sudo chown Exp1 TP1
307 sudo chown exp1 TP1
308 ls -lrt
309 cat /etc/passwd
310 sudo chown exp1 TP1
311 sudo chown exp1 /Pthon/TP1
312 sudo chown exp1 /TP1
313 cat /etc/passwd | grep exp
314 ls -lrt Unix
315 sudo chown -R exp1 Unix/TP1
316 ls -lrt Unix
317 sudo chown -R exp2 Python/
318 cd TP/
319 cd TP1/
320 cd TP2/
321 sudo chown -R exp2 Python
322 ls -lrt
323 cd
324 ls -lrt
325 cdcd
326 cd -lrt Python
327 ls -lrt Python
328 cd Unix/TP1/seance1
329 cd Unix/TP2/seance1
330 cd Unix
331 ls
332 cd TP1
333 ls
334 ls -s cd
335 cd
336 cd Unix/TP1/
337 ls
338 ls -s Unix/TP1/exo1 lien
339 ls -s Unix/TP1/ lien
340 cd
341 sudo apt install zip
342 tar -czvf system.tar.gz Unix
343 tar -cJvf system.tar.xz Unix
344 tar -cJvf system.tar.bz2 Unix
345 tar -cjvf system.tar.bz2 Unix
346 cd
347 ls -lrt
348 tar -czvf Unix.tar.gz
349 tar -czvf Unix.tar.gz Unix
350 cd
351 ls
352 cd Unix
353 ls
354 cd system
355 cd
356 cd system
357 sudo cd system
358 l
359 cd
360 tar -czvf Unix.tar.gz Unix
361 tar -cxvf Unix.tar.gz Unix
362 mkdir Python/data
363 tar -cxvf Unix.tar.gz Python/data
364 tar -cxvf Unix.tar.gz Python/data/
365 su exp2
366 sudo netsat -patune | grep ssh
367 su - epx2
368 su -epx2
369 clear
370 ssh-keygen -t rsa
371 y
372 ssh-keygen -t rsa
373 ssh-copy-id -i /home/ofi03/.ssh/id_rsa.pub -p 55600 [email protected]
374 ssh-copy-id -i /home/ofi03/.ssh/id_rsa.pub -p 55600 [email protected]
375 ps -ef | grep tomcat
376 cd /etc/systemd/system/
377 vim tomcat.service
378 sudo vim tomcat.service
379 sudo systemctl restart tomcat.service
380 sudo systemctl daemon-reload tomcat.service
381 sudo systemctl daemon-reload
382 sudo systemctl restart tomcat.service
383 vim tomcat.service
384 ps -ef | grep tomcat
385 sudo cd /opt/tomcat/bin
386 cd /opt/tomcat/bin
387 sudo vim catalina.sh
388 sudo vim setenv.sh
389 sudo systemctl restart tomcat.service
390 ps -ef | grep tomcat
391 cd
392 ps -ef | grep tomcat
393 sudo systemctl status tomcat.service
394 journalctl -u tomcat
395 sudo journalctl -u tomcat
396 nano /etc/systemd/system/tomcat.service
397 sudo journalctl -u tomcat
398 sudo systemctl restart tomcat.service
399 ps -ef | grep tomcat
400 journalctl -u tomcat
401 ps -ef | grep tomcat
402 sudo vim setenv.sh
403 sudo systemctl daemon-reload
404 sudo systemctl restart tomcat.service
405 cd /opt/tomcat/bin
406 sudo vim setenv.sh
407 sudo systemctl restart tomcat.service
408 ps -ef | grep tomcat
409 sudo su -l tomcat -s /bin/bash -c 'jmap -dump:format=b, file=dump1.hprof
286223'
410 ps -ef | grep tomcat
411 sudo su -l tomcat -s /bin/bash -c 'jmap -dump:format=b, file=dump1.hprof
91901'
412 sudo su -l tomcat -s /bin/bash -c 'jmap -dump:format=b,file=dump1.hprof
91901'
413 ls -lrt
414 cd /opt/tomcat
415 ls -lrt
416 cd
417 ls -lrt
418 cd /opt/tomcat
419 mv dump1.hprof /home/ofi03/
420 sudo mv dump1.hprof /home/ofi03/
421 sudo chown ofi03:ofi03 /home/ofi03/dump1.hprof
422 d /bin/setenv
423 cd /bin
424 sudo vim setenv.sh
425 cd /bin/
426 ls
427 sudo vim setenv.sh
428 cd /opt/
429 ls-lrt
430 ls -lrt
431 cd /etc/postgresql/12/
432 ls -lrt
433 cd main
434 ls -lrt
435 sudo vim postgresql.conf
436 cd
437 cd /etc/postgresql/12/main
438 ls -lrt
439 sudo vim postgresql.conf
440 cd /etc/postgresql/12/main
441 ls -lrt
442 sudo vim postgresql.conf
443 ls -lrt
444 sudo vim pg_hba.conf
445 systemctl status postgresql
446 ps -aux | grep postgresql
447 pg_c
448 sudo pg_ctlcluster 12 main status
449 psql -h 146.59.156.114 -p 5432 postgres postgres
450 sudo pg_ctlcluster 12 main status
451 psql -h 146.59.156.114 -p 5432 postgres postgres
452 systemctl restart postgresql
453 psql -h 146.59.156.114 -p 5432 postgres postgres
454 sudo vim pg_hba.conf
455 psql -h 146.59.156.114 -p 5432 postgres postgres
456 systemctl restart postgresql
457 sudo pg_ctlcluster 12 main status
458 psql -h 146.59.156.114 -p 5432 postgres postgres
459 sudo su -
460 sudo vim pg_hba.conf
461 psql -h 146.59.156.114 -p 5432 postgres postgres
462 sudo vim pg_hba.conf
463 psql -h 146.59.156.114 -p 5432 postgres postgres
464 sudo su -
465 sudo vim pg_hba.conf
466 cd
467 cd /etc/postgresql/12/main/
468 ls -lrt
469 sudo vim pg_hba.conf
470 cd /etc/postgresql/12/main/
471 sudo vim pg_hba.conf
472 cd /etc/postgresql/12/main/
473 sudo vim pg_hba.conf
474 sudo su -
475 systemctl status tomcat
476 shutdown
477 systemctl shutdown tomcat
478 cd /opt/tomcat
479 ls -lrt
480 shutdown
481 systemctl stop tomcat
482 systemctl status tomcat
483 systemctl stop tomcat.service
484 systemctl status tomcat
485 sudo su -
486 systemctl restart postgresql
487 sudo su -
488 systemctl restart postgresql
489 systemctl status postgresql.service
490 systemctl restart postgresql
491 sudo su -
492 systemctl status postgresql.service
493 cd /etc/postgresql/12/main
494 ls -lrt
495 systemctl status postgresql.service
496 sudo su -
497 cd
498 sudo apt install postgresql postgresql contrib
499 sudo apt install postgresql postgresql-contrib
500 ls -lrt
501 cd /etc/postgresql/12/main
502 sudo vim postgresql.conf
503 cd
504 sudo su -
505 psql -h 146.59.156.114 -p 5432 postgres postgres
506 sudo su -
507 sudo postgresql
508 sudo postgres
509 sudo - postgres
510 sudo su -
511 history
512 sudo systemctl status apache2.service
513 sudo systemctl start apache2.service
514 sudo vim /etc/apache2/conf-available/security.conf
515 cd /etc/apache2/sites-available
516 ls
517 sudo vim 01-www.secondsite.com.conf
518 sudo vim 01-www.logwire.org.conf
519 sudo htpasswd -c /etc/apache2/passwords Amadou
520 sudo systemctl restart apache2.service
521 sudo vim 01-www.logwire.org.conf
522 sudo vim 01-www.secondsite.com.conf
523 sudo vim 01-www.logwire.org.conf
524 sudo vim 01-www.secondsite.com.conf
525 sudo systemctl restart apache2.service
526 ls
527 cd /var/www/html/www.secondsite.com/top_secret/
528 ls
529 sudo vim index.html
530 sudo systemctl restart apache2.service
531 ls
532 sudo vim index.html
533 cd
534 cd /etc/apache2/sites-available/
535 ls -lrt
536 sudo vim 01-www.secondsite.com.conf
537 sudo vim 01-www.logwire.org.conf
538 sudo vim 01-www.secondsite.com.conf
539 sudo systemctl restart apache2.service
540 sudo systemctl restart apache2.service
541 sudo systemctl restart apache2.service
542 sudo systemctl status apache2.service
543 cd
544 sudo systemctl status apache2
545 sudo systemctl restart apache2.service
546 sudo systemctl status apache2.service
547 ss -lrtnp
548 sudo systemctl restart apache2.service
549 journalctl -xe
550 sudo systemctl restart apache2.service
551 sudo apt-get install apache2
552 sudo systemctl status apache2.service
553 sudo systemctl restart apache2.service
554 sudo systemctl status apache2.service
555 sudo systemctl status apache2.service
556 sudo systemctl start apache2.service
557 sudo systemctl restart apache2.service
558 journalctl -xe
559 sudo systemctl stop apache2.service
560 sudo systemctl status apache2.service
561 sudo systemctl restart apache2.service
562 sudo apt-get install apache2
563 sudo systemctl restart apache2.service
564 sudo systemctl status apache2.service
565 sudo systemctl restart apache2.service
566 systemctl status apache2.service
567 sudo systemctl start apache2.service
568 systemctl status apache2.service
569 sudo systemctl restart apache2.service
570 sudo apt update
571 sudo systemctl restart apache2.service
572 sudo apt install default
573 jdksudo apt install default
574 sudo apt install default-jdk
575 history
576 cd /opt/tomcat/bin/
577 ls
578 ls -lrt
579 cd ..
580 ls -lrt
581 cd conf
582 ls -lrt
583 sudo vim server.xml
584 sudo systemctl status apache2.service
585 sudo systemctl restart apache2.service
586 ls -lrt
587 sudo systemctl restart apache2.service
588 sudo vim server.xml cd
589 cd
590 cd /var/www/html/www.secondsite.com/top_secret/
591 ls
592 sudo vim index.html
593 cd ../../
594 ls
595 sudo vim index.html
596 sudo systemctl restart apache2.service
597 sudo systemctl start apache2.service
598 systemctl status apache2.service
599 journalctl -xe
600 systemctl status apache2.service
601 which lib
602 systemctl stop apache2.service
603 sudo systemctl status apache2.service
604 ps -aux
605 ps -aux |grep apache
606 ss -lrtnp
607 is-active apache-tomcat-9.0.65.tar.gz
608 is active apache-tomcat-9.0.65.tar.gz
609 activate apache-tomcat-9.0.65.tar.gz
610 ss -lrtnp
611 sudo systemctl restart apache2.service
612 history
613 clear
614 history
615 sudo systemctl restart apache2.service
616 systemctl status apache2.service
617 sudo systemctl restart apache2.service
618 sudo apt-get purge apache2
619 sudo apt-get install apache2
620 sudo systemctl status apache2.service
621 sudo systemctl restart apache2.service
622 cd /etc/apache2/sites-available/
623 ls
624 sudo vim 01-www.secondsite.com.conf
625 cd
626 ls
627 cd /var/www/html/www.secondsite.com/
628 ls
629 cd top_secret/
630 ls
631 sudo vim index.html
632 sudo systemctl restart apache2.service
633 cd
634 sudo a2enmod
635 sudo a2enmod ssl
636 sudo systemctl restart apache2.service
637 sudo
638 openssl req x509 nodes days 365 newkey rsa:2048 keyout / ssl private
/apache selfsigned.key out
639 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsign
640 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
641 -help
642 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
643 sudo nano /etc/apache2/sites
644 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
645 sudo apachectl configtest
646 sudo systemctl reload apache2.service
647 sudo systemctl restart apache2.service
648 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
649 sudo vim /etc/apache2/sites-available/01-www.logwire.org.conf
650 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
651 sudo systemctl restart apache2.service
652 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
653 sudo systemctl restart apache2.service
654 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
655 sudo openssl -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
656 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
657 history
658 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key-out /etc/ssl/certs/apache-selfsigned.crt
659 history
660 sudo systemctl restart apache2.service
661 sudo vim /etc/apache2/sites-available/01-www.secondsite.com.conf
662 sudo vim /opt/tomcat/conf/tomcat-users.xml
663 sudo vim /opt/tomcat/conf
664 sudo vim /opt/tomcat/conf/
665 cd /opt/tomcat/conf/
666 ls -lrt
667 sudo vim logging.properties
668 sudo vim context.xml
669 sudo vim logging.properties
670 cd ..
671 ls -lrt
672 history
673 cd / | grep sentenv
674 ls
675 history | setenv
676 cd /opt/
677 ls
678 cd /opt/tomcat
679 ls
680 cd conf
681 ls
682 cd ..
683 ls
684 cd conf
685 ls
686 cd
687 ls
688 cd ..
689 ls
690 cd
691 cd /etc/
692 ls
693 cd systemd/system/
694 ls
695 cd
696 cd /opt/tomat/
697 cd
698 cd /opt/tomat/
699 cd /opt/tomcat/
700 ls
701 cd bin
702 ls
703 sudo vim setenv.sh
704 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
705 cd postgresql-tomcat/db
706 cp init.sql /home/ubuntu
707 sudo cp init.sql /home/ubuntu/
708 su -postgres
709 sudo su -postgres
710 su - postgres
711 sudo su - postgres
712 su postgres
713 sudo su postgres
714 \q
715 cd
716 exit
717 cd /opt/tomcat
718 ls
719 cd /opt/tomcat
720 cd conf/
721 ls
722 sudo vim server.xml
723 ls
724 cd bin
725 ls
726 sudo vim setenv.sh
727 cd /opt/systemd/
728 cd /etc/systemd/
729 cd system/
730 ls
731 sudo vim tomcat.service
732 cd
733 sudo vim /opt/tomcat/conf/tomcat-users.xml
734 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
735 cd postgresql-tomcat/db
736 cp init.sql /home/ubuntu
737 sudo cp init.sql /home/ubuntu
738 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
739 cd postgresql-tomcat/db
740 sudo cp init.sql /home/ubuntu
741 su -- postgres
742 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.gitcd
743 cd
744 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.gitcd
745 sudo systemctl restart postgresql
746 sudo systemctl restart tomcat.service
747 systemctl daemon-reload
748 sudo systemctl daemon-reload
749 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.gitcd
750 git clone https://gitlab.com/houcemdevops/postgresql-tomcat.git
751 cd postgresql-tomcat/db
752 sudo cp init.sql /home/ubuntu
753 su - postgres
754 sudo su - postgres
755 sudo vim /etc/prometheus/prometheus.yml
756 dpkg -l apache2
757 cd /etc/apache2/
758 ls -lrt
759 cd conf-available/
760 ls -lrt
761 cd
762 find -Name "error.log"
763 find -name "error.log"
764 sudo find -name "error.log"
765 sudo find -name "access.log"
766 sudo find "access.log"
767 find "access.log"
768 sudo find "error.log"
769 sudo find -name "error.log"
770 sudo find -name / "error.log"
771 sudo find -name "error.log" /
772 cd /etc/apache2/
773 ls -lrt
774 sudo vim apache2.conf
775 sudo vim conf-available/
776 sudo vim envares
777 cd
778 cd /opt/tomcat/
779 ls -lrt
780 cd logs/
781 ls -lrt
782 cd catalina.out
783 sudo vim catalina.out
784 cd /opt/tomcat/
785 ls -lrt
786 cd conf/
787 ls -lrt
788 sudo vim server.xml
789 sudo vim catalina.p
790 sudo vim catalina
791 sudo vim tomcat-users.xml
792 sudo vim logging.properties
793 sudo vim context.xml
794 cd /etc/systemd/system/
795 ls -lrt
796 cd
797 cd /opt/tomcat/
798 ls -lrt
799 cd bin
800 ls -lrt
801 ./version.sh
802 cd
803 df -h
804 top
805 free -h
806 adduser oracle
807 sudo adduser oracle
808 id oracle
809 sudo su - oracle
810 sudo mkdir /opt/oracle
811 sudo unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip -d
/opt/oracle/
812 sudo vim ~/.profile
813 sudo chown oracle:oracle /opt/oracle
814 su - oracle
815 sudo chown oracle:oracle -R /opt/oracle/instantclient_19_8
816 sudo su - oracle
817 sudo su - oracle
818 sudo chown oracle:oracle -R /opt/oracle/instantclient_19_8
819 sudo su - oracle
820 history
821 sqlplus ot_admin/ot_password@L0CAL_PDB1
822 sudo su - oracle
823 sudo apt install ansible
824 ansible
825 versionansible
826 ansible --version
827 sudo adduser ansadmin
828 sudo nano /etc/
829 sudo vim /etc/sudoers
830 cd /etc/sudoers.d/
831 sudo cd /etc/sudoers.d/
832 cd /etc/sudoers.d/
833 sudo su -
834 sudo su - ansadmin
835 sudo su - ansadmin
836 ansible all -bm group -a "name=rennes"
837 ansible all -bm group -a "name=rennes"
838 sudo su - ansadmin
839 sudo su - ansadmin
840 ll
841 cd projetgit/
842 ll
843 ssh
844 ssh-keygen -t rsa
845 git clone [email protected]:logwire9/projet1.git
846 ssh-keygen -t rsa
847 cd
848 cat .ssh/id_rsa.pub
849 ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABgQDRXIB324zopABpaxXK8QQKhwMWlILiCpMOnWZMzM5zejf2I0+eGYNGY
rva+6LjnvcmZDUHKcS+19LeNewqk3o41xzSF6r2/FkKEc0xbu7bpY5Gyzxjh0XiDMVIF
g3NjKBN17+9to5doSGYnbBU53IFFEhFSBr3jg2+UzzSbmW76ZNlr7wu5kD/yoROkN7eRVmfjt4PtzwK3sg8gG
EdhwDrgXlWkoYgw2BjoXtecnR27iXwFnFoMsr2By05GZ0Ap7lTdZVqsIAyBZyyAov2VJwzn/4rEu8RPjBL8
WtGr5PCImmv0flcWiEYKY7EvDHb3e+wI8t0Bi+ExIU8ULifoOEYVXNH0mxM5RGVRFBrOFI654286qWe9PxYzi
oFJ/w8j0YqAtPKtA9E32zR9LN+cLtu7vUBrhPDFjBSNxO/+/iUR0Ig+R4mvfYWgontuICBvDQ5vC6zx9E/B
vZsY21kopqh62KzqwsmJPe0benNsLMomNSMzh2zlKCIqJytSFIMtKk= ofi03@svl200
850 cd projetgit/.
851 git clone [email protected]:logwire9/projet1.git
852 ll
853 cd projet1/
854 ll
855 sudo vim conflit.txt
856 sudo vim java.txt
857 git add .
858 git commit -m "ajout fichier java"
859 git push conflit.txt
860 git push
861 sudo vim java.txt
862 git add .
863 git commit -m "modif fichier java"
864 git push
865 git pull
866 sudo vim java.txt
867 git add .
868 git commit -m "modif fichier"
869 git push
870 git branch
871 git bra
872 git branch
873 git branch dev
874 git branch
875 git checkout dev
876 git branch
877 ll
878 git log --oneline
879 git push conflit.txt
880 sudo vim conflit.txt
881 git add .
882 git commit -m "modif fichier conflit"
883 git push
884 git push
885 git commit -m "modif fichier conflit"
886 git commit -m "modif fichier conflit.txt"
887 git log --oneline --graph --decorate -all
888 git dev --oneline --graph --decorate -all
889 git log --oneline --graph --decorate --all
890 git checkout master
891 git merge dev
892 git log --oneline --graph --decorate --all
893 git push
894 git log --oneline --graph --decorate --all
895 cd ../../
896 mkdir projetmerge
897 cd projetmerge/
898 git clone https://gitlab.com/logwire7/projet1.git
899 git branch
900 cd ..
901 cd projetgit/
902 mv ../projetmerge/ ..
903 mv ../projetmerge/ .
904 ll
905 cd projetmerge/
906 git branch
907 git clone https://gitlab.com/logwire7/projet1.git
908 git branch aaw
909 git branch
910 git checkout aaw
911 git branch
912 ll
913 sudo vim aaw.txt
914 git push origin aaw
915 ll
916 git branch
917 cd
918 cd projetgit/projet1/
919 ll
920 git
921 git branch aaw
922 git branch
923 git checkout aaw
924 ll
925 sudo vim index.html
926 git add .
927 git commit -m "modif index"
928 git push origin aaw
929 git push origin master
930 cd ..
931 cd projetmerge/
932 ll
933 sudo vim aaw.txt
934 ll
935 sudo vim index.html
936 git add .
937 git commit -m "modif index"
938 git push origin aaw
939 git branch
940 git branch aaw
941 git branch
942 git checkout aaw
943 git push origin aaw
944 git push origin master
945 git tag
946 ll
947 git log --oneline
948 git tag v1.2 45109db
949 git log --oneline
950 git tag v1.2 cea8cbf
951 git push origin v1.2
952 git tag v1.3 45109db
953 git push origin v1.3
954 sudo su - ansadmin
955 history
956 sudo su - ansadmin
957 ll
958 cd projetgit/
959 ll
960 cd
961 sudo su - ansadmin
962 ls
963*
964 ls
965 ls -lrt
966 cd
967 sudo su - ansadmin
968 history
ofi03@svl200:~$
ofi03@svl200:~$ sudo su - ansadmin
[sudo] password for ofi03:
ansadmin@svl200:~$ cd tpansible/
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ ansible-galaxy init tomcat
- Role tomcat was created successfully
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles tomcat
ansadmin@svl200:~/tpansible$ cd tomcat/
ansadmin@svl200:~/tpansible/tomcat$ 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/tomcat$ rm -r ../tomcat/
ansadmin@svl200:~/tpansible/tomcat$
ansadmin@svl200:~/tpansible/tomcat$ cd ..
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ cd roles/
ansadmin@svl200:~/tpansible/roles$ ls
postgres
ansadmin@svl200:~/tpansible/roles$ cp postgres/ tomcat
cp: -r not specified; omitting directory 'postgres/'
ansadmin@svl200:~/tpansible/roles$ cp -r postgres/ tomcat
ansadmin@svl200:~/tpansible/roles$ ls
postgres tomcat
ansadmin@svl200:~/tpansible/roles$ tree
.
├── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── tomcat
├── README.md
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
│ └── index.html.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
18 directories, 18 files
ansadmin@svl200:~/tpansible/roles$ cd ..
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
ansadmin@svl200:~/tpansible$ cp psql.yml tomcat.yml
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles
tomcat.yml
ansadmin@svl200:~/tpansible$ cd roles
ansadmin@svl200:~/tpansible/roles$ ls
postgres tomcat
ansadmin@svl200:~/tpansible/roles$ mv tomcat/ ../
ansadmin@svl200:~/tpansible/roles$ cd ..
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles tomcat
tomcat.yml
ansadmin@svl200:~/tpansible$ mkdir roles1
ansadmin@svl200:~/tpansible$ mv -r tomcat tomcat.yml hosts_vars hosts.yml group_vars/
role
role_postgres/ roles/ roles1/
ansadmin@svl200:~/tpansible$ mv -r tomcat tomcat.yml hosts_vars hosts.yml group_vars/
role1/
mv: invalid option -- 'r'
Try 'mv --help' for more information.
ansadmin@svl200:~/tpansible$ mv tomcat tomcat.yml hosts_vars hosts.yml group_vars/
role1/
mv: target 'role1/' is not a directory
ansadmin@svl200:~/tpansible$ mv -r tomcat tomcat.yml hosts_vars hosts.yml group_vars/
roles1/
mv: invalid option -- 'r'
Try 'mv --help' for more information.
ansadmin@svl200:~/tpansible$ mv tomcat tomcat.yml hosts_vars hosts.yml group_vars/
roles1/
ansadmin@svl200:~/tpansible$ ls
psql.yml role_postgres roles roles1
ansadmin@svl200:~/tpansible$ cd roles1
ansadmin@svl200:~/tpansible/roles1$ ls
group_vars hosts.yml hosts_vars tomcat tomcat.yml
ansadmin@svl200:~/tpansible/roles1$ cp group_vars/ hosts_vars/ hosts.yml ../
cp: -r not specified; omitting directory 'group_vars/'
cp: -r not specified; omitting directory 'hosts_vars/'
ansadmin@svl200:~/tpansible/roles1$ cp -r group_vars/ hosts_vars/ hosts.yml ../
ansadmin@svl200:~/tpansible/roles1$ ls
group_vars hosts.yml hosts_vars tomcat tomcat.yml
ansadmin@svl200:~/tpansible/roles1$ cd ..
ansadmin@svl200:~/tpansible$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── psql.yml
├── role_postgres
│ ├── group_vars
│ │ └── all.yml
│ ├── hosts.yml
│ ├── psql.yml
│ └── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
├── roles
│ └── postgres
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── roles1
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── tomcat
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── tomcat.yml
35 directories, 36 files
ansadmin@svl200:~/tpansible$
ansadmin@svl200:~/tpansible$ ls
group_vars hosts.yml hosts_vars psql.yml role_postgres roles roles1
ansadmin@svl200:~/tpansible$ cd roles1
ansadmin@svl200:~/tpansible/roles1$ ls
group_vars hosts.yml hosts_vars tomcat tomcat.yml
ansadmin@svl200:~/tpansible/roles1$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── tomcat
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── tomcat.yml
11 directories, 12 files
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat/tasks/main.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat/templates/main.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat/handlers/main.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat/vars/main.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat/tasks/main.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim group_vars/main.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim group_vars/all.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat.yml
ansadmin@svl200:~/tpansible/roles1$ ansible-playbook tomcat.yml
ERROR! Syntax Error while loading YAML.
did not find expected '-' indicator
PLAY RECAP
*************************************************************************************
**********************************************
146.59.158.16 : ok=6 changed=4 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
**********************************************
146.59.158.16 : ok=6 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
**********************************************
146.59.158.16 : ok=6 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
PLAY RECAP
*************************************************************************************
**********************************************
client1 : ok=6 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
ansadmin@svl200:~/tpansible/roles1$
ansadmin@svl200:~/tpansible/roles1$ ansible-playbook -i hosts.yml tomcat.yml
PLAY RECAP
*************************************************************************************
**********************************************
client1 : ok=6 changed=0
unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
11 directories, 12 files
ansadmin@svl200:~/tpansible/roles1$ sudo vim hosts.yml
ansadmin@svl200:~/tpansible/roles1$ sudo vim group_vars/all.yml
ansadmin@svl200:~/tpansible/roles1$ cd
ansadmin@svl200:~$ cat .ssh/
id_rsa id_rsa.pub known_hosts
ansadmin@svl200:~$ cat .ssh/known_hosts
|1|RVVdjR0l/PNc9uQtwHvh8wChn74=|qaOQ1MbunrHtMa1/JHNrG9YMgkA= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOn8ceAE4
EDAWwmXkogeKexuv0b82zK+3VenUUR8P2cicoaQSsQ83fldYHzqhVSP5x98ZhqkHaHMgBkSMZY8rBQ=
|1|yH6mRVh7VbDKKf+RzUKEpvtxLQE=|x7Vrxym8rZqA86xoD7+2tFzW5fs= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI/DltbME
I4mx39YGnOyDuwfMsI0a4+UzPIcDIB5BPxI0o5sj1ih/x5dFcEV97lpOtwDf36oTm2L+7kjomYRfv0=
|1|8qnhZ1lMwFyptzzeZNXUBKXLZRo=|1qgR6JWO3e0cdcdbcyEe0Bem+AU= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOn8ceAE4
EDAWwmXkogeKexuv0b82zK+3VenUUR8P2cicoaQSsQ83fldYHzqhVSP5x98ZhqkHaHMgBkSMZY8rBQ=
|1|bUTvvb+ASxW5/PBY0gTe84rR6yE=|xYQPo3dV3CDjDz4Ggx9uKlapH38= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI/DltbME
I4mx39YGnOyDuwfMsI0a4+UzPIcDIB5BPxI0o5sj1ih/x5dFcEV97lpOtwDf36oTm2L+7kjomYRfv0=
|1|euO5ysYD6dgRDVJGHrYdCICMDAo=|xlE5RAwFDRGNV05CO6SBp+9jytU= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG8PqcXsS
h5Vvwivd1pQOPOLalsVxzMqJYhflwpyK1oYSR/oqbA4cCbBmZa8D9zWU/m6E/2Xytm2sA3VBOzONlw=
|1|LUKyysrrI5CJEWLBy6YfGWBVaao=|cy70o20KxHND15WCQrdJxKqsAq4= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV
9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY=
|1|RT26KX64H7b/dkbyt7/9GvUeiEQ=|2JFdtSYjZuhqKInvEmdmf+9A/mA= ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV
9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY=
ansadmin@svl200:~$ pwd
/home/ansadmin
ansadmin@svl200:~$ cat /home/ansadmin/.ssh/known_hosts ^C
ansadmin@svl200:~$ sudo vim group_vars/all.yml
ansadmin@svl200:~$ cd tpansible/
.git/ group_vars/ hosts_vars/ role_postgres/ roles/
roles1/
ansadmin@svl200:~$ cd tpansible/role
role_postgres/ roles/ roles1/
ansadmin@svl200:~$ cd tpansible/roles1/
group_vars/ hosts_vars/ tomcat/
ansadmin@svl200:~$ cd tpansible/roles1/group_vars/
ansadmin@svl200:~/tpansible/roles1/group_vars$ sudo vim all.yml
ansadmin@svl200:~/tpansible/roles1/group_vars$
ansadmin@svl200:~/tpansible/roles1/group_vars$ cd ..
ansadmin@svl200:~/tpansible/roles1$ tree
.
├── group_vars
│ └── all.yml
├── hosts.yml
├── hosts_vars
├── tomcat
│ ├── README.md
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── index.html.j2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
└── tomcat.yml
11 directories, 12 files
ansadmin@svl200:~/tpansible/roles1$ sudo vim tomcat/tasks/main.yml
ansadmin@svl200:~/tpansible/roles1$ ansible-playbook tomcat.yml
─────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────
───────────────────────────────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file