Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### SETTING UP ANSIBLE
- ##### On Ansible control as user student
- [student@rocky ~]$ history
- 1 sudo dnf install epel-release
- 2 sudo dnf install -y ansible
- 3 sudo sh -c 'echo 192.168.29.229 ubuntu.example.com ubuntu >> /etc/hosts'
- 4 sudo sh -c 'echo 192.168.29.230 rocky.example.com rocky >> /etc/hosts'
- 5 cat /etc/hosts
- 6 sudo useradd -G wheel ansible
- 7 sudo passwd ansible
- 8 su - ansible
- 9 history
- ##### On Ansible control as user ansible
- [ansible@rocky ~]$ history
- 1 ssh-keygen
- 2 ssh-copy-id ubuntu
- 3 ssh-copy-id student@ubuntu
- 4 ssh 'student@ubuntu'
- 5 echo ubuntu >> inventory
- 6 ansible ubuntu -m ping -i inventory -u student -K
- 7 ansible ubuntu -m ping -i inventory -u student
- 8 history
- 11 cat inventory
- 12 ansible ubuntu -i inventory -u student -m user -a "name=linda"
- 13 ansible ubuntu -i inventory -u student -m user -a "name=linda" -b
- 14 ansible ubuntu -i inventory -u student -m user -a "name=linda" -b -K
- 15 ansible -i inventory -b -K -u student -m command -a "id linda"
- 16 ansible -i inventory -b -K -u student ubuntu -m command -a "id linda"
- 17 ansible -i inventory -b -K -u student ubuntu -m shell -a "echo passwd | passwd --stdin linda"
- 18 ansible -i inventory -b -K -u student ubuntu -m package -a "name=nmap"
- 19 sudo dnf install -y vim git
- 20 git clone https://github.com/sandervanvugt/devopsinfourweeks
- 21 ansible -i inventory -b -K -u student ubuntu -m shell -a "echo linda:password | chpasswd"
- 22 cd devopsinfourweeks/
- 23 ls
- 24 vim ansible.cfg
- 25 ansible -K -m package -a "name=nmap"
- 26 cp ../inventory .
- 27 ansible ubuntu -K -m package -a "name=nmap"
- 28 vim deploy-webserver.yaml
- 29 ls
- 30 vim ans-deploy-webserver.yaml
- 31 vim create-webserver.yaml
- 32 ansible-doc service
- 33 ansible-playbook create-webserver.yaml
- 34 ansible-playbook create-webserver.yaml -K
- 35 ls
- 36 vim ansible-ubuntu.yml
- 37 ansible-playbook ansible-ubuntu.yml
- 38 ansible-playbook ansible-ubuntu.yml -K
- 39 history
- ##### On the Ubuntu VM
- student@student-virtual-machine:~/devopsinfourweeks$ history
- 1 cd ../devopsinfourweeks/
- 2 ./counter.sh 15
- 3 sudo apt update
- 4 sudo apt install jenkins
- 5 history
- 6 history -w
- 7 sudo apt update
- 8 sudo apt install jenkins
- 9 history
- 10 history -w
- 11 exit
- 12 history
- 13 sudo -i
- 14 sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
- 15 curl -fsSL https://download.docker.com/linux/ubuntu/gpp | sudo apt-key add -
- 16 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- 17 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- 18 sudo apt update
- 19 sudo apt install docker-ce docker-ce-cli containerd.io
- 20 sudo docker run hello-world
- 21 ps aux | grep jenkins
- 22 sudo usermod -aG docker jenkins
- 23 sudo systemctl restart jenkins
- 24 sudo usermod -aG docker student
- 25 history -w
- 26 history
- 27 cd devopsinfourweeks/
- 28 ls
- 29 cat firstpipeline
- 30 sudo docker images
- 31 cat secondpipeline
- 32 sudo docker images
- 33 sudo apt install openssh-server
- 34 ip a
- 35 ./counter.sh 12
- 36 history
Advertisement
Add Comment
Please, Sign In to add comment