Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ansible@control install]$ cat setupuser.yaml
- ---
- - name: create a user and home environment
- hosts: all
- tasks:
- - name: create user
- command: useradd linda
- - name: copy file to user home
- copy:
- src: /etc/hosts
- dest: /home/linda
- [ansible@control install]$ cat setupuser2.yaml
- ---
- - name: create a user and home environment
- hosts: all
- tasks:
- - name: create user
- user:
- name: linda
- - name: copy file to user home
- copy:
- src: /etc/hosts
- dest: /home/linda
- [ansible@control install]$ cat installvim.yaml
- ---
- - name: install my favourite editor
- vars:
- myeditor: vim
- hosts: all
- tasks:
- - name: install {{ myeditor }}
- package:
- name: "{{ myeditor }}"
- [ansible@control base]$ cat greeter.yaml
- ---
- - name: test group vars
- hosts: file
- tasks:
- - debug:
- msg: the greeting is {{ greet }}
- [ansible@control base]$ tree group_vars/
- group_vars/
- └── file
- 0 directories, 1 file
- [ansible@control base]$ cat group_vars/file
- greet: hello
- 1 su -
- 2 exit
- 3 id
- 4 sudo yum install epel-release -y
- 5 sudo yum install -y ansible
- 6 ansible --version
- 7 ssh-keygen
- 8 ssh-copy-id ansible1
- 9 sudo vim /etc/hosts
- 10 sudo vi /etc/hosts
- 11 ssh-copy-id ansible1
- 12 ssh ansible1
- 13 ssh-copy-id ansible2
- 14 mkdir install
- 15 cd install/
- 16 vi inventory
- 17 ansible all -i inventory --list-hosts
- 18 history
- 19 su -i
- 20 su -
- 21 vim inventory
- 22 vi inventory
- 23 cd ..
- 24 sudo yum install vim git -y
- 25 git clone https://github.com/sandervanvugt/ansible-4h
- 26 git clone https://github.com/sandervanvugt/ansible-3h
- 27 cd ansible-3h/
- 28 ls
- 29 cd install/
- 30 ls
- 31 cat inventory
- 32 cd ..
- 33 git clone https://github.com/sandervanvugt/luth
- 34 cd luth/
- 35 ls
- 36 ./countdown 12
- 37 cd ../ansible-3h/install/
- 38 ls
- 39 cat inventory
- 40 history
- 41 vim ansible.cfg
- 42 ansible all --list-hosts
- 43 ansible all -i ../../inventory --list-hosts
- 44 sudo vim /etc/ansible/hosts
- 45 ansible ansible1 -m command -a who
- 46 ping ansible1
- 47 vim inventory
- 48 ansible ansible1 -m command -a who
- 49 vim ansible.cfg
- 50 ssh ansible1
- 51 ansible ansible1 -m command -a who
- 52 ansible ansible1 -m command -a ls -l /root
- 53 ansible ansible1 -m command -a "ls -l /root"
- 54 sudo vim /etc/ansible/hosts
- 55 cd ..
- 56 ansible ansible1 -m command -a "ls -l /root"
- 57 cd install/
- 58 ansible all -m user -a "name=lisa"
- 59 ansible all -m comman -a "id lisa"
- 60 ansible all -m command -a "id lisa"
- 61 history | grep ansible
- 62 ansible-doc -l
- 63 ansible-doc -l | wc
- 64 ansible-doc -l
- 65 ansible-doc user
- 66 ansible all -m command -a "rpm -qa | grep vim"
- 67 ansible all -m shell -a "rpm -qa | grep vim"
- 68 history
- 69 vim vsftpd.yml
- 70 ansible-doc yum
- 71 ansible-doc copy
- 72 ansible-doc lineinfile
- 73 ansible-doc blockinfile
- 74 pwd
- 75 ../../luth/countdown 12
- 76 vim vsftpd.yml
- 77 ansible-playbook vsftpd.yml
- 78 vim vsftpd.yml
- 79 ansible-playbook vsftpd.yml
- 80 ssh ansbile2
- 81 ssh ansible2
- 82 ansible-playbook vsftpd.yml
- 83 vim setupuser.yaml
- 84 ansible-playbook setupuser.yaml
- 85 ansible all -m command -a "rm /home/linda/hosts"
- 86 ansible all -m file -a "name=/home/linda/hosts state=absent"
- 87 ansible-playbook setupuser.yaml
- 88 cp setupuser.yaml setupuser2.yaml
- 89 vim setupuser2.yaml
- 90 ansible-playbook setupuser2.yaml
- 91 cat setupuser.yaml
- 92 cat setupuser2.yaml
- 93 ssh ansible1
- 94 ssh ansible2
- 95 ansible-playbook vsftpd.yml
- 96 vim installvim.yaml
- 97 ansible-playbook installvim.yaml
- 98 vim installvim.yaml
- 99 ansible-playbook installvim.yaml
- 100 ls
- 101 cat installvim.yaml
- 102 cd ..
- 103 cd base/
- 104 ls
- 105 ansible all -m setup | less
- 106 ansible-doc -l | grep fact
- 107 ansible-doc -l | grep fact | less
- 108 ansible-doc -l package_facts
- 109 ansible-doc package_facts
- 110 ansible ansible1.example.com -m setup -a "filter=ansible_kernel"
- 111 ansible ansible1.example.com -m setup -a "filter=ansible_distribution"
- 112 ansible all -m setup | less
- 113 ansible ansible1.example.com -m setup -a "filter=ansible_default_ipv4"
- 114 ansible ansible1.example.com -m setup -a "filter=ansible_default_ipv4.address"
- 115 ansible all -m setup | less
- 116 ls
- 117 vim when-test.yml
- 118 ansible-playbook when-test.yml
- 119 pwd
- 120 ../../luth/countdown 12
- 121 vim when-test.yml
- 122 ansible-playbook when-test.yml
- 123 vim when-test.yml
- 124 ansible-playbook when-test.yml
- 125 vim when-test.yml
- 126 ansible-playbook when-test.yml
- 127 history | grep filter
- 128 ansible all -m setup -a "filter=ansible_default_ipv4"
- 129 ansible all -m setup -a "filter=ansible_facts['distribution']"
- 130 ansible all -m setup -a "filter=ansible_facts"
- 131 vim variables.yml
- 132 ansible-playbook variables.yml
- 133 vim when-test.yml
- 134 ls
- 135 cd ..
- 136 grep -r 'handler' *
- 137 cd loops/
- 138 ls
- 139 cd ..
- 140 sudo yum install -y tree
- 141 tree | less
- 142 cd ..
- 143 git clone https://github.com/sandervanvugt/rhce8-book
- 144 cd rhce8-book/
- 145 ls
- 146 ls | wc
- 147 cd host_vars/
- 148 ls
- 149 vim ansible1
- 150 cd ..
- 151 grep '{{ users' *
- 152 vim listing616.yaml
- 153 vim listing615.yaml
- 154 vim listing74.yaml
- 155 cd ../ansible-3h/
- 156 cd base
- 157 ls
- 158 cat inventory
- 159 vim inventory
- 160 mkdir group_vars
- 161 vim group_vars/file
- 162 vim greeter.yaml
- 163 ansible-playbook greeter.yaml
- 164 vim greeter.yaml
- 165 ansible-playbook greeter.yaml
- 166 vim group_vars/file
- 167 ansible-playbook greeter.yaml
- 168 cat greeter.yaml
- 169 tree group_vars/
- 170 cat group_vars/file
- 171 cd ..
- 172 grep -r 'register' *
- 173 cd loops/
- 174 vim register.yml
- 175 vim register2.yml
- 176 ansible-playbook register2.yml
- 177 vim register2.yml
- 178 ansible-playbook register2.yml
- 179 vim register2.yml
- 180 ansible-playbook register2.yml
- 181 vim register2.yml
- 182 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement