Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ansible@control lesson5]$ cat todayis.yml
- ---
- - name: printing stuff
- hosts: ansible1.example.com
- tasks:
- - name: classic notation
- debug:
- msg: today is {{ ansible_date_time.date }}
- - name: since 2.5
- debug:
- msg: today is {{ ansible_facts.date_time.date }}
- - name: avoided deprecated syntax
- debug:
- msg: today is {{ ansible_facts['date_time']['date'] }}
- - name: avoiding deprecated in injected variables
- debug:
- msg: today is {{ ansible_date_time['date'] }}
- [ansible@control lesson5]$ cat user.yml
- ---
- - name: create a user using a variable
- hosts: all
- vars_files:
- - vars/users.yml
- tasks:
- - name: create a user {{ user }}
- debug:
- msg: "{{ user }} will be added to {{ mygroups }}"
- - name: once more
- debug:
- var: user
- [ansible@control lesson5]$ history
- 1 sudo vim /etc/hosts
- 2 ip a
- 3 ping ansible1
- 4 ping ansible2
- 5 sudo yum install epel-release
- 6 sudo yum install ansible
- 7 ansible --version
- 8 sudo dnf install -y vim git
- 9 git clone https://github.com/sandervanvugt/rhce8-live
- 10 git clone https://github.com/sandervanvugt/rhce8-book
- 11 cd rhce8-live/
- 12 ls
- 13 cd lesson2/
- 14 ls
- 15 vim inventory
- 16 history
- 17 pwd
- 18 vim inventory
- 19 sudo vim /etc/ansible/hosts
- 20 pwd
- 21 ansible all -m ping
- 22 cat ansible.cfg
- 23 ansible -i inventory all --list-hosts
- 24 ansible file --list-hosts
- 25 cat inventory
- 26 ansible web --list-hosts
- 27 ls ..
- 28 ../countdown 15
- 29 vim ansible.cfg
- 30 ansible --version
- 31 sudo vim /etc/ansible/ansible.cfg
- 32 ansible all -m user -a "name=lisa"
- 33 ansible --help | less
- 34 #ansible all -m user -a "name=ansible groups=wheel" -u root -k
- 35 ansible-doc user
- 36 ansible all -m user -a "name=ansible groups=wheel" -u root -k
- 37 vim inventory
- 38 ansible all -m user -a "name=ansible groups=wheel" -u root -k
- 39 ansible all -m command -a "cat /etc/shadow" -u root -k
- 40 #ansible all -m command -a "echo password | passwd --stdin ansible"
- 41 ansible all -m command -a "cat /etc/passwd | grep ansible" -u root -k
- 42 ansible all -m shell -a "cat /etc/passwd | grep ansible" -u root -k
- 43 ansible all -m shell -a "echo password | passwd --stdin ansible" -u root -k
- 44 ansible all -m command -a "cat /etc/shadow" -k
- 45 cat ansible.cfg
- 46 ansible all -m command -a "cat /etc/shadow" -k -K
- 47 ansible all -m command -a "cat /etc/shadow" -K
- 48 ansible all -m shell -a 'echo "ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ansible' -K
- 49 ssh ansible1
- 50 ansible all -m shell -a 'echo "ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ansible' -K -k
- 51 ansible all -m shell -a 'cat /etc/shadow' -k
- 52 ssh-keygen
- 53 ssh-copy-id ansible1
- 54 ssh-copy-id ansible2
- 55 ansible all -m shell -a 'cat /etc/shadow'
- 56 history
- 57 ansible-doc -l | less
- 58 ansible-doc -l | wc
- 59 ansible-doc user
- 60 less /usr/lib/python3.6/site-packages/ansible/modules/system/user.py
- 61 ansible all -m ping
- 62 ansible all -m service -a "name=httpd state=started"
- 63 ansible all -m user -a "name=linda state=present"
- 64 ansible all -m command -a "useradd lisa"
- 65 history
- 66 ../countdown 15
- 67 ansible all -m package -a "name=namp state=present"
- 68 ansible all -m package -a "name=nmap state=present"
- 69 ansible all -m shell -a "rpm -qa | grep nmap"
- 70 cd ../lesson4/
- 71 l
- 72 ls
- 73 cat inventory
- 74 ls
- 75 vim vsftpd.yml
- 76 ansible-playbook vsftpd.yml
- 77*
- 78 vim vsftpd.yml
- 79 ansible ansible2.example.com -a "cat /var/ftp/pub/README"
- 80 ansible -v ansible2.example.com -a "cat /var/ftp/pub/README
- 81 history
- 82 ansible-playbook -v vsftpd.yml
- 83 ansible-playbook -vvvv vsftpd.yml
- 84 vim vsftpd.yml
- 85 ansible-playbook vsftpd.yml
- 86 vim vsftpd.yml
- 87 ansible-playbook vsftpd.yml
- 88 sudo yum provides */ansible-lint
- 89 sudo yum install -y python3-ansible-lint
- 90 ansible-lint vsftpd.yml
- 91 vim vsftpd.yml
- 92 ansible-lint --help | less
- 93 ansible-lint -L
- 94 ls
- 95 vim web-setup-and-test.yml
- 96 ansible-playbook web-setup-and-test.yml
- 97 vim web-setup-and-test.yml
- 98 ../countdown 17
- 99 vim es.yaml
- 100 ansible-playbook es.yaml
- 101 vim es.yaml
- 102 ansible-playbook es.yaml
- 103 vim es.yaml
- 104 ansible-playbook es.yaml
- 105 cd ../lesson5/
- 106 ls
- 107 vim user.yml
- 108 ansible-playbook user.yml
- 109 vim user.yml
- 110 ansible-playbook user.yml
- 111 vim inventory
- 112 ansible-playbook user.yml -e user=bob
- 113 vim user.yml
- 114 ansible-doc user
- 115 vim user.yml
- 116 ansible-playbook user.yml
- 117 vim user.yml
- 118 ansible-playbook user.yml
- 119 grep vars_file
- 120 grep vars_file *
- 121 mkdir vars
- 122 vim vars/users
- 123 vim user.yml
- 124 ansible-playbook user.yml
- 125 cd vars
- 126 mv users users.yml
- 127 cd ..
- 128 ansible-playbook user.yml
- 129 cat user.yml
- 130 ansible-playbook user.yml
- 131 vim user.yml
- 132 ansible-playbook user.yml
- 133 vim user.yml
- 134 ansible ansible1.example.com -m setup > facts.txt
- 135 less facts.txt
- 136 vim todayis.yml
- 137 less facts.txt
- 138 vim todayis.yml
- 139 ansible-playbook todayis.yml
- 140 vim todayis.yml
- 141* ansible-playbook todayis.yml
- 142 ansible-playbook todayis.yml
- 143 vim todayis.yml
- 144 ansible-playbook todayis.yml
- 145 vim todayis.yml
- 146 ansible-playbook todayis.yml
- 147 cat user.yml
- 148 cat todayis.yml
- 149 cat user.yml
- 150 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement