Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@control ~]# history
- 1 yum install python epel-release -y
- 2 yum install python38 epel-release -y
- 3 yum install -y ansible
- 4 vim /etc/hosts
- 5 ping ansible2
- 6 ping ansible1
- 7 exit
- 8 cat /etc/os-release
- 9 free -m
- 10 df -h
- 11 yum install -y vim bash-completion git
- 12 su - ansible
- 13 useradd ansible
- 14 passwd ansible
- 15 su - ansible
- 16 exit
- 17 history
- #### config files
- [ansible@control install]$ cat makeuser.yml
- ---
- - name: create a user
- hosts: ansible2.example.com
- tasks:
- - name: create user
- user:
- name: linda
- state: present
- uid: 1010
- - name: print a dummy message
- debug:
- msg: hello everybody
- #### config files[ansible@control loops]$ cat vardemo1.yaml
- ---
- - name: demonstrating variable use
- hosts: ansible1.example.com
- vars:
- user: linda
- tasks:
- - name: create user {{ user }}
- user:
- name: "{{ user }}"
- state: present
- - name: checking
- debug:
- msg: the user {{ user }} exists
- [ansible@control base]$ cat un-ansible-loop.yml
- ---
- - name: clean up all
- hosts: all
- tasks:
- - name: remove services
- yum:
- name:
- - httpd
- - vsftpd
- state: absent
- - name: remove files
- file:
- path: "{{ item }}"
- state: absent
- loop:
- - /etc/ansible/facts.d
- - /var/www/html/index.html
- - /var/ftp/pub/README
- - /etc/motd
- #####COMMAND
- [ansible@control base]$ history
- 1 git clone https://github.com/sandervanvugt/ansible-3h
- 2 cd ansible-3h/
- 3 ls
- 4 history
- 5 su -
- 6 ssh-keygen
- 7 ssh-copy-id ansible1
- 8 ssh-copy-id ansible2
- 9 ssh ansible1
- 10 ssh ansible2
- 11 pwd
- 12 ls
- 13 cd install/
- 14 ls
- 15 cat /etc/hosts
- 16 ls
- 17 pwd
- 18 vim inventory
- 19 vim ansible.cfg
- 20 ansible all -i inventory --list-hosts
- 21 ansible -m command -a "useradd bob"
- 22 ansible all -m command -a "useradd bob"
- 23 vim ansible.cfg
- 24 ansible --help
- 25 exit
- 26 history
- 27 ssh root@ansible1
- 28 ansible all -m command -a "useradd bob"
- 29 pwd
- 30 cd ansible-3h/install/
- 31 ansible all -m command -a "useradd bob"
- 32 vim ansible
- 33 ansible all -m raw -a "echo ansible ALL=(ALL) NOPASSWD:ALL > /etc/sudoers.d/ansible" -u root -k
- 34 ansible all -m raw -a 'echo ansible ALL=\(ALL\) NOPASSWD:ALL > /etc/sudoers.d/ansible' -u root -k
- 35 history
- 36 ansible all -m command -a "useradd bob"
- 37 history
- 38 cd ..
- 39 git clone https://github.com/sandervanvugt/luth
- 40 cd luth/
- 41 ./countdown 12
- 42 ansible ansible1.example.com -m command -a who
- 43 sudo vim /etc/ansible/hosts
- 44 su -
- 45 exit
- 46 id
- 47 sudo vim /etc/ansible/hosts
- 48 sudo vim /etc/ansible/ansible.cfg
- 49 cd ansible-3h/
- 50 cd install/
- 51 ansible ansible1.example.com -m command -a who
- 52 ansible ansible1.example.com -m shell -a who
- 53 ansible ansible1.example.com -m raw -a who
- 54 ansible ansible1.example.com -m command -a "rpm -qa | grep completion"
- 55 ansible ansible1.example.com -m shell -a "rpm -qa | grep completion"
- 56 ansible-doc -l | less
- 57 ansible-doc -l | wc
- 58 ansible -m command -a "useradd lisa"
- 59 ansible all -m command -a "useradd lisa"
- 60 ansible all -m user -a "name=lisa"
- 61 ansible all -m user -a "name=linda"
- 62 history
- 63 ansible-doc user
- 64 ansible all -m user -a "name=linda state=absent remove=yes"
- 65 vim vsftpd.yml
- 66 ansible-playbook vsftpd.yml
- 67 vim vsftpd.yml
- 68 ansible-playbook vsftpd.yml
- 69 vim vsftpd.yml
- 70 ansible-playbook vsftpd.yml
- 71 cd ..
- 72 ls
- 73 cd base
- 74 ls
- 75 cd ../ftp/
- 76 ls
- 77 cd ../install/
- 78 ls
- 79 vim makeuser.yml
- 80 ansible-playbook makeuser.yml
- 81 vim makeuser.yml
- 82 ansible-playbook makeuser.yml
- 83 history
- 84 ansible all -m user -a "name=linda state=absent remove=yes"
- 85 ansible-playbook makeuser.yml
- 86 vim makeuser.yml
- 87 vim ~/.vimrc
- 88 history
- 89 vim makeuser.yml
- 90 ansible-playbook makeuser.yml
- 91 ansible ansible2.example.com -a "tail /etc/passwd"
- 92 ansible ansible2.example.com -m setup | less
- 93 sleep 20; ~/luth/countdown 12
- 94 cat makeuser.yml
- 95 ansible ansible2.example.com -m setup > ../myfacts.txt
- 96 cd ..
- 97 less myfacts.txt
- 98 cd base
- 99 vim when-test.yml
- 100 ansible-playbook when-test.yml
- 101 vim inventory
- 102 vim when-test.yml
- 103 ansible-playbook when-test.yml
- 104 vim when-test.yml
- 105 ansible-playbook when-test.yml
- 106 vim when-test.yml
- 107 ls
- 108 cd ../install/
- 109 vim vsftpd.yml
- 110 ansible-playbook vsftpd.yml
- 111 cd ../base/
- 112 ls
- 113 cd ..
- 114 grep -R handler *
- 115 cd loops/
- 116 ls
- 117 vim handlers.yml
- 118 ansible-playbook handlers.yml
- 119 vim handlers.yml
- 120 touch /tmp/index.html
- 121 ansible-playbook handlers.yml
- 122 vim handlers.yml
- 123 ansible-playbook handlers.yml
- 124 ansible ansible1.example.com -m file -a "state=absent name=/var/www/html/index.html"
- 125 vim handlers.yml
- 126 ansible-playbook handlers.yml
- 127 vim handlers.yml
- 128 ansible ansible1.example.com -m file -a "state=absent name=/var/www/html/index.html"
- 129 ansible-playbook handlers.yml
- 130 ansible-playbook -vvvv handlers.yml
- 131 ls
- 132 cd ..
- 133 grep -r var *
- 134 ls
- 135 cd includes/
- 136 ls
- 137 cd ../includes/
- 138 ls
- 139 cd ../loops/
- 140 ls
- 141 vim vardemo1.yaml
- 142 cat vardemo1.yaml
- 143 ansible-playbook vardemo1.yaml
- 144 cat vardemo1.yaml
- 145 sleep 30; ~/luth/countdown 12
- 146 ansible-doc -l | grep jenkins
- 147 vim vardemo1.yaml
- 148 ansible-playbook vardemo1.yaml -e user=anna
- 149 vim vardemo1.yaml
- 150 ansible-playbook vardemo1.yaml -e user=anna
- 151 vim vardemo1.yaml
- 152 vim inventory
- 153 ansible-playbook vardemo1.yaml
- 154 vim inventory
- 155 ls
- 156 cd ..\
- 157 tree
- 158 ansible localhost -m yum -a "name=tree state=latest"
- 159 ansible localhost -m dnf -a "name=tree state=latest"
- 160 sudo yum install -y tree
- 161 cd ..
- 162 tree
- 163 cd loops/
- 164 mkdir group_vars
- 165 cd group_vars/
- 166 vim all
- 167 cd ..
- 168 vim inventory
- 169 ansible-playbook vardemo1.yaml
- 170 vim group_vars/all
- 171 ansible-playbook vardemo1.yaml
- 172 grep vars_ *
- 173 grep -R vars_ * ../
- 174 vim vardemo1.yaml
- 175 rm -rf group_vars/
- 176 mkdir vars
- 177 vim vars/users.yml
- 178 ansible-playbook vardemo1.yaml
- 179 vim register3.yml
- 180 ansible-playbook register3.yml
- 181 vim register3.yml
- 182 ansible-playbook register3.yml
- 183 cd ../..
- 184 git clone https://github.com/sandervanvugt/rhce8-book
- 185 cd rhce8-book/
- 186 ls
- 187 ls | wc
- 188* grep -l register *
- 189 vim listing728.yaml
- 190* vim listing8a.yaml
- 191 grep -e register -e when *
- 192 vim listing83.yaml
- 193 ansible-playbook listing83.yaml
- 194 cd ../ansible-3h/
- 195 cd includes/
- 196 vim site.yml
- 197 vim tasks/file.yml
- 198 ls
- 199 cd ../loops/
- 200 ls
- 201 cd ..
- 202 tree
- 203 cd base
- 204 ls
- 205 vim un-ansible.yml
- 206 vim un-ansible-loop.yml
- 207 cat un-ansible-loop.yml
- 208 ansible-playbook un-ansible
- 209 ansible-playbook un-ansible-loop.yml
- 210 history
Add Comment
Please, Sign In to add comment