Tuesday, August 21, 2018

ansible ping example

Playbok file @ ping.yaml

---
- hosts: master4
  remote_user: sevone
  gather_facts: False
  tasks:
    - name: test connection
      ping:
      remote_user: sevone

Command

Syntax
ansible-playbook -i <inventory filename> -u <username> ping.yaml

Output

[root@master sdi]# ansible-playbook -i master4 -u sevone ping.yaml

PLAY [master4] ***************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************************************************
ok: [master4]

TASK [test connection] *******************************************************************************************************************************************************************************************************************
ok: [master4]

PLAY RECAP *******************************************************************************************************************************************************************************************************************************
master4                    : ok=2    changed=0    unreachable=0    failed=0

[root@master sdi]#

Screenshot

Output of command

Output

[root@master sdi]# ansible-playbook -i master4 -u sevone ping.yaml
 
PLAY [master4]
 
TASK [Gathering Facts] ok: [master4]
 
TASK [test connection] ok: [master4]
 
PLAY RECAP master4 : ok=2 changed=0 unreachable=0 failed=0

Blog URL

test

this is test page

First plan is to setup docker and kubernets in the lab

Ansible testing from stackedit


Thursday, August 16, 2018

Ansible AWX install



yum update -y && yum install -y epel-release && yum install -y openssh-clients tmux nano unzip traceroute wget docker git net-tools  bind-utils yum-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct docker ansible php python-pip && pip install docker-py && pip install --upgrade pip

yum install -y python-pip && pip install docker-py && pip install --upgrade pip

yum install -y nginx
sudo mv /etc/nginx/sites-enabled/default ~/nginx_default

cd awx;
cd installer;
grep -v '^ *#' inventory

#uncomment 
awx_alternate_dns_servers="10.1.2.3,10.2.3.4"
project_data_dir=/var/lib/awx/projects

ansible-playbook -i inventory install.yml;

sudo docker exec -it awx_task bash -c "echo "nameserver 8.8.8.8" >> /etc/resolv.conf"
sudo docker exec -it awx_task bash -c "cat /etc/resolv.conf"

sudo docker exec -it awx_web bash -c "echo "nameserver 8.8.8.8" >> /etc/resolv.conf"
sudo docker exec -it awx_web bash -c "cat /etc/resolv.conf"


echo "nameserver 8.8.8.8" >> /etc/resolv.conf
/usr/bin/git clone --origin origin https://github.com/ansible/ansible-tower-samples


nameserver 10.168.0.50
nameserver 10.193.0.50
nameserver 8.8.8.8

scp 10.168.119.177:/bin/ngrok /bin/ngrok
chmod +x /bin/ngrok
ngrok http 80



sudo docker exec -it awx_web bash -c "ls -lh /var/lib/awx/projects"; sudo docker exec -it awx_task bash -c "ls -lh /var/lib/awx/projects"







Reference:




SevOne, Inc. reserves the right to monitor the transmission of this message and to take corrective action against any misuse or abuse of its e-mail system or other components of its network.

The information contained in this e-mail may be confidential and/or legally privileged. It is intended solely for the addressee.  If the reader of this message is not an intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited and may be unlawful. If you have received this communication in error, please reply to the sender and destroy all copies of the message.  To contact us directly, send to postmaster@sevone.com