Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ansible@control lesson5]$ cat variables_example.yaml
- ---
- - name: variables test
- vars:
- myuser: linda
- hosts: ansible1.example.com
- tasks:
- - name: defining user {{ myuser }}
- debug:
- msg: creating {{ myuser }}
- - name: doing it
- user:
- name: "{{ myuser }}"
- [ansible@control lesson5]$ cat askme.yaml
- ---
- - name: ask me anything
- vars_prompt:
- - name: my_answer
- prompt: which package do you want to install
- private: no
- hosts: all
- tasks:
- - debug:
- msg: the answer is {{ my_answer }}
- ---
- - name: create user
- vars:
- myuser: bill
- mygroups: sales
- hosts: ansible1.example.com
- tasks:
- - name: adding groups
- group:
- name: "{{ mygroups }}"
- - name: creating users
- user:
- name: "{{ myuser }}"
- groups: "{{ mygroups }}"
- [ansible@control facts]$ cat printfacts.yaml
- ---
- - name: print the facts about the facgts
- hosts: ansible2
- tasks:
- - debug:
- msg: the package is {{ ansible_facts.ansible_local.localfacts['myfacts']['package'] }}
- [ansible@control lesson8]$ history
- 1 ip a
- 2 sudo vim /etc/hosts
- 3 ping ansible1
- 4 sudo vim /etc/hosts
- 5 ping ansible1
- 6 ping ansible2
- 7 ping ansible3
- 8 sudo yum install -y epel-release
- 9 sudo yum install ansible
- 10 sudo yum update -y
- 11 sudo yum install ansible
- 12 sudo reboot
- 13 sudo yum install ansible
- 14 sudo yum provides */sshpass
- 15 sudo yum install ansible --nobest
- 16 sudo yum install ansible --skip-broken
- 17 sudo -i
- 18 sudo yum install ansible
- 19 sudo vim /etc/yum.repos.d/oldepel.repo
- 20 sudo cat /etc/yum.repos.d/oldepel.repo
- 21 ansible --version
- 22 ping ansible1
- 23 mkdir setup
- 24 cd setup
- 25 vim inventory
- 26 ansible -i inventory all -m ping
- 27 ssh root@ansible1
- 28 ssh root@ansible2
- 29 ssh root@ansible3
- 30 ansible -i inventory all -m ping
- 31 ansible -i inventory all -m ping -u root -k
- 32 history
- 33 ansible -i inventory all -u root -k -m command -a "useradd ansible"
- 34 sudo useradd ansible
- 35 echo $?
- 36 ansible -i inventory all -u root -k -m user -a "name=ansible"
- 37 ansible -i inventory all -u root -k -m user -a "name=bob"
- 38 history
- 39 ansible -i inventory all -u root -k -m shell -a "echo password | passwd --stdin ansible"
- 40 ssh ansible@ansible1
- 41 history
- 42 ansible -i inventory all -u ansible -k -m command -a "whoami"
- 43 ansible -i inventory all -u ansible -k -m command -a "ls -l /root"
- 44 ansible -i inventory all -u root -k -m shell -a '"ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ansible'
- 45 ansible -i inventory all -u root -k -m shell -a 'echo "ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ansible'
- 46 ssh ansible1
- 47 ansible -i inventory all -u ansible -k -m command -a "ls -l /root"
- 48 ansible -i inventory all -u ansible -k -b -m command -a "ls -l /root"
- 49 ssh-keygen
- 50 ssh-copy-id ansible1
- 51 ssh-copy-id ansible2
- 52 ssh-copy-id ansible3
- 53 ssh ansible3
- 54 ansible -i inventory all -u ansible -b -m command -a "ls -l /root"
- 55 history
- 56 pwd
- 57 vim inventory
- 58 sudo vim /etc/ansible/hosts
- 59 ansible --version
- 60 ansible -i inventory all --list-hosts
- 61 ansible db --list-hosts
- 62 ansible -i inventory db --list-hosts
- 63 history
- 64 sudo vim /etc/ansible/ansible.cfg
- 65 ansible --version
- 66 vim ansible.cfg
- 67 ansible --version
- 68 cd ..
- 69 sudo yum install git
- 70 git clone https://github.com/sandervanvugt/rhce8-live
- 71 ls
- 72 cd rhce8-live/
- 73 ls
- 74 cd lesson2/
- 75 ls
- 76 vim ansible.cfg
- 77 vim inventory
- 78 ansible all -m command -a "ls -l /root"
- 79 history
- 80 ansible-doc -l |wc
- 81 ansible-doc -l
- 82 ansible-doc user
- 83 ansible all -m service -a "name=httpd state=started"
- 84 ansible all -m service -a "name=crond state=started"
- 85 ansible all -m service -a "name=crond state=stopped"
- 86 ansible all -m command -a "/sbin/reboot -t now"
- 87 ansible all -m command -a "/sbin/reboot"
- 88 ansible all -m service -a "name=crond state=started"
- 89 cd
- 90 ansible all -m ping
- 91 ls
- 92 ansible all -m ping -i setup/inventory
- 93 cd rhce8-live/
- 94 ls
- 95 ./countdown 14
- 96 cd lesson2/
- 97 ansible all -m package -a "name=nmap"
- 98 ansible-doc yum
- 99 ansible all -m service -a "name=httpd state=started"
- 100 yum demostructure.yaml
- 101 vim demostructure.yaml
- 102 ansible-playbook demostructure.yaml
- 103 vim demostructure.yaml
- 104 ansible-playbook demostructure.yaml
- 105 cat demostructure.yaml
- 106 vim demostructure.yaml
- 107 ansible-playbook demostructure.yaml
- 108 vim demostructure.yaml
- 109 ansible-playbook demostructure.yaml
- 110 vim demostructure.yaml
- 111 ansible-playbook demostructure.yaml
- 112 vim demostructure.yaml
- 113 vim ~/.vimrc
- 114 ls
- 115 cd ../lesson5
- 116 ls
- 117 grep vsftp *
- 118 cd ..
- 119 ls
- 120 cd lesson4
- 121 ls
- 122 vim vsftpd.yml
- 123 ansible-playbook vsftpd.yml
- 124 history
- 125 ansible-playbook vsftpd.yml
- 126 sudo vim /etc/hosts
- 127 ansible-doc copy
- 128 ansible all -m copy -a "src=/etc/hosts dest=/etc/hosts"
- 129 ansible-playbook vsftpd.yml
- 130 history
- 131 vim ansible.cfg
- 132 ansible-playbook vsftpd-err.yml
- 133 vim vsftpd-err.yml
- 134 ansible-playbook vsftpd-err.yml
- 135 ansible-playbook --syntax-check vsftpd-err.yml
- 136 ansible-playbook -v vsftpd.yml
- 137 ansible-playbook -vvvv vsftpd.yml
- 138 sudo yum provides */ansible-lint
- 139 sudo yum install -y python3-ansible-lint
- 140 ansible-lint -L
- 141 ansible-lint vsftpd.yml
- 142 ansible all -m setup | less
- 143 cd ../lesson5/
- 144 vim inventory
- 145 ls
- 146 cd ../lesson4/
- 147 ls
- 148 cd ..
- 149 cd lesson7/
- 150 ls
- 151 cd
- 152 find -name "variables_example.*"
- 153 cd rhce8-live/
- 154 cd lesson5/
- 155 ls
- 156 vim variables_example.yaml
- 157 ansible-playbook variables_example.yaml
- 158 vim variables_example.yaml
- 159 ansible-playbook variables_example.yaml
- 160 vim variables_example.yaml
- 161 ansible-playbook variables_example.yaml -e myuser=bob
- 162 cat variables_example.yaml
- 163 find ~ -name "variables_example.*"
- 164 ls
- 165 cd ../..
- 166 git clone https://github.com/sandervanvugt/rhce8
- 167 git clone https://github.com/sandervanvugt/rhce8-book
- 168 find ~ -name "variables_example.*"
- 169 vim askme.yaml
- 170 cd rhce8-book/
- 171 grep vars_prompt
- 172 grep vars_prompt *
- 173 vim listing710.yaml
- 174 cd -
- 175 vim askme.yaml
- 176 vim rhce8-book/listing710.yaml
- 177 vim askme.yaml
- 178 ansible-playbook askme.yaml
- 179 mv askme.yaml rhce8-live/lesson5/
- 180 cd rhce8-live/lesson5/
- 181 ls
- 182 ansible-playbook askme.yaml
- 183 vim inventory
- 184 vim askme.yaml
- 185 ansible-playbook askme.yaml
- 186 cat askme.yaml
- 187 ls
- 188 cd webservers/
- 189 ls
- 190 pwd
- 191 ls
- 192 cat inventory
- 193 tree
- 194 vim group_vars/lamp
- 195 vim site.yml
- 196 ansible-playbook site.yml
- 197 history
- 198 cd ..
- 199 vim create_user.yaml
- 200 ansible-playbook create_user.yaml
- 201 vim create_user.yaml
- 202 ansible-playbook create_user.yaml
- 203 vim create_user.yaml
- 204 ansible-playbook create_user.yaml
- 205 ansible-doc -l | grep group
- 206 ansible-doc group
- 207 vim create_user.yaml
- 208 ansible-playbook create_user.yaml
- 209 cat create_user.yaml
- 210 ../countdown 12
- 211 vim ct.yaml
- 212 ansible -u root - inventory remotehost -k -m raw -a "yum install -y python3"
- 213 ansible -u root -i inventory remotehost -k -m raw -a "yum install -y python3"
- 214 ansible-vault --help
- 215 cd ../lesson7/
- 216 ls
- 217 cd vault/
- 218 ls
- 219 ansible-vault create secret.yml
- 220 cat secret.yml
- 221 vim create-user.yml
- 222 ansible-playbook create-user.yml
- 223 ansible-playbook --ask-vault-pass create-user.yml
- 224 ansible ansible1.example.com -a "tail /etc/shadow"
- 225 echo password > ~/vault-pass
- 226 ansible-playbook --vault-password-file=~/vault-pass create-user.yml
- 227 history
- 228 vim secret.dummy
- 229 cat secret.dummy
- 230 cat create-user.yml
- 231 ansible ansible1.example.com -m setup | less
- 232 history | grep copy
- 233 cd ..
- 234 pwd
- 235 cd facts/
- 236 ls
- 237 vim facts.yml
- 238 ansible-playbook facts.yml
- 239 vim ansible.cfg
- 240 ansible-playbook facts.yml
- 241 vim inventory
- 242 ansible-playbook facts.yml
- 243 vim ipfact.yml
- 244 ansible-playbook ipfact.yml
- 245 vim ipfact.yml
- 246 pwd
- 247 ../../countdown 13
- 248 vim ipfact.yml
- 249 ls
- 250 vim newlocalfacts.yml
- 251 vim localfacts.fact
- 252 ansible-playbook newlocalfacts.yml
- 253 vim inventory
- 254 ansible-playbook newlocalfacts.yml
- 255 ansible ansible2 -m setup -a "filter=ansible_local"
- 256 vim printfacts.yaml
- 257 ansible-playbook printfacts.yaml
- 258 vim printfacts.yaml
- 259 ansible-playbook printfacts.yaml
- 260 vim printfacts.yaml
- 261 ansible-playbook printfacts.yaml
- 262 vim printfacts.yaml
- 263 ansible-playbook printfacts.yaml
- 264 vim printfacts.yaml
- 265 cat printfacts.yaml
- 266 ls
- 267 vim setupfactcache.yaml
- 268 ansible -m setup ansible2
- 269 ansible -m setup ansible2 | less
- 270 cd ..
- 271 ls
- 272 cd arrays/
- 273 ls
- 274 vim inventory
- 275 tree
- 276 cat vars/users-dictionary
- 277 cat vars/users-list
- 278 ls
- 279 vim multi-list.yml
- 280 ansible-playbook multi-list.yml
- 281 ansible-playbook multi-dictionary.yml
- 282 vim multi-dictionary.yml
- 283 ls
- 284 pwd
- 285 ../../countdown 13
- 286 cd ..
- 287 ls
- 288 cd lesson8/
- 289 ls
- 290 vim loopservices.yml
- 291 ansible-playbook loopservices.yml
- 292 vim loopservices.yml
- 293 ansible-playbook loopservices.yml
- 294 vim loopusers.yml
- 295 ansible-playbook loopusers.yml
- 296 vim loop-over-variable.yml
- 297 cat loopvars.yml
- 298 vim loop-over-variable.yml
- 299 ansible-playbook loop-over-variable.yml
- 300 ls
- 301 vim register_loop.yml
- 302 ansible-playbook register_loop.yml
- 303 im register_command.yml
- 304 vim register_command.yml
- 305 vim register_loop.yml
- 306 ansible-playbook register_loop.yml
- 307 vim register_loop.yml
- 308 ansible-playbook register_loop.yml
- 309 vim register_loop.yml
- 310 ansible-playbook register_loop.yml
- 311 vim register_loop.yml
- 312 ansible-playbook register_loop.yml
- 313 vim register_command.yml
- 314 ansible-playbook register_command.yml
- 315 vim register_command.yml
- 316 ansible-playbook register_command.yml
- 317 vim register_command.yml
- 318 vim distro.yml
- 319 ansible-playbook distro.yml
- 320 vim distro.yml
- 321 ansible-playbook distro.yml
- 322 vim distro.yml
- 323 vim distro.yml -e mypackage=vsftpd
- 324 ansible-playbook distro.yml -e mypackage=vsftpd
- 325 vim quicktest.yml
- 326 ansible-playbook quicktest.yml
- 327 vim quicktest.yml
- 328 ansible-playbook quicktest.yml
- 329 vim command-output-test.yml
- 330 vgs
- 331 sudo vgs
- 332 ansible-playbook command-output-test.yml
- 333 vim command-output-test.yml
- 334 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement