Jenkins ansible docker - Kabrinskiy Eduard
<h1>Jenkins ansible docker</h1>
<p>[youtube]</p>
Jenkins ansible docker <a href="http://remmont.com">Today's big news</a> Jenkins ansible docker
<h1>Ansible 2.0</h1>
<p>This tutorial is experimental or just to play with Ansible and Docker. Actually, we need to setup ssh within the container, and then Ansible installs nginx from outside, which is really weird situation.</p>
<p>Also, trying to install/run ssh on a container may not be a proper way of start using Docker, and as showed in my other tutorials (listed below) are probably the ways we want to use Ansible and Docker together:</p>
<p><ol>
<li>Launch micro services (wordpress, mysql, varnish, proxy server separately on each container): <br />Deploying Wordpress micro-services with Docker containers on Vagrant box via Ansible</li>
<li>All in one (nginx server with app in one container). But we can deploy two env containers (dev and prod). <br />Quick Preview - Setting up web servers with Nginx, configure enviroments, and deploy an App</li>
</ol>
</p>
<p>However, with the current approach, I ended up running ssh using "docker exec" against a running container.</p>
<p>Anyway, I hope this experimental (playful) page has something we can learn from.</p>
<p>There have been quite a few debates on docker ssh whether it's a right approach or not. However, this tutorial is not about ssh but about Ansible. So, I stick to sshing to a container.</p>
<p>Create a user other than root:</p>
<p>Then, copy public key to /home/k/.ssh/authorized_keys.</p>
<p>Later the newly create user should be able to install packages, so we need to add the user 'k' to 'sudoers':</p>
<p>Also, we prefer not to use password when we try to install something as sudo. So, let's edit sudoers using "visudo":</p>
<p>As will be discussed later, we want to set the ssh to auto-start at boot otherwise it won't running when we start the docker run. So, we cannot ssh to the container. Let's check it if it's set that way:</p>
<p>Indeed. It's not set. So, let's do it now:</p>
<p>Autorun at boot time is set. Though it supposed to start automatically when we start to run this container, it's not.</p>
<p>So, at this point, we may want to issue "docker exec" against the running container:</p>
<p>Anyway, we can still move on because it does not affect what we're try to do.</p>
<p>Now that we know the ip of the docker container, we can ssh to it:</p>
<p>This time, we can ping the container using Ansible.</p>
<p>First, we need to create a customized inventory:</p>
<p>Then, let Ansible know where it can find hosts:</p>
<p>Let's ping it via Ansible:</p>
<p>Yes, we can connect to the container via Ansible.</p>
<p>At this point, we may want to save the works we've onto Ubuntu image. So, exit from docker.</p>
<p>We're now in a regular linux shell. Let's see what's in the docker process list:</p>
<p>To save a new image, we should commit it:</p>
<p>where the 'b9b2ee7004fe' is the container-id and 'ubuntu-ssh-k' is the new name of the image.</p>
<p>We are back to where we left off!</p>
<p>But there is a catch. IP address of our container has been changed:</p>
<p>So, we need to update Ansible hosts in <b>/home/k/ansible_hosts</b>.</p>
<p>Also, we need to more on the container: restart ssh:</p>
<p>If the sss service won't start, we may have to do one more thing before we restart ssh servcie.</p>
<p>To install Ngix on Ubuntu servers, we'll use <b>apt</b> module.</p>
<p>This will use the <b>apt</b> module to update the repository cache and install Nginx. If we run it again:</p>
<p>The result of running the Task was <b>"changed": false</b>. This shows that there were no changes; We had already installed Nginx. We can run this command repeatedly without worrying about it affecting the desired result (idempotence).</p>
<p>The <b>-a</b> flag is used to pass any arguments to the module. I use <b>-s</b> to run this command using <b>sudo</b>.</p>
<p>We can run all of our tasks using modules in this ad-hoc way, however, we want to perform these task in more managable way using a <b>Playbook</b>, which can run and coordinate multiple tasks.</p>
<p>On our container, let's run nginx:</p>
<p style="clear: both"> <img src="https://www.bogotobogo.com/DevOps/Ansible/images/Docker1/NginxOnDocker.png" /></p>
<p>Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization</p>
<p><i>Sponsor Open Source development activities and free contents for everyone.</i></p>
<h2>Jenkins ansible docker</h2>
<h3>Jenkins ansible docker</h3>
<p>[youtube]</p>
Jenkins ansible docker <a href="http://remmont.com">Live news</a> Jenkins ansible docker
<h4>Jenkins ansible docker</h4>
Ansible - Deploy Nginx to Docker
<h5>Jenkins ansible docker</h5>
Jenkins ansible docker <a href="http://remmont.com">Jenkins ansible docker</a> Jenkins ansible docker
SOURCE: <h6>Jenkins ansible docker</h6> <a href="https://dev-ops.engineer/">Jenkins ansible docker</a> Jenkins ansible docker
#tags#[replace: -,-Jenkins ansible docker] Jenkins ansible docker#tags#
https://ssylki.info/?who=remmont.com/di ... re-careers https://ssylki.info/?who=fix-my-credit.remmont.com https://ssylki.info/?who=renters-insurance.remmont.com https://ssylki.info/?who=cash-out.remmont.com https://ssylki.info/?who=remmont.com/ne ... planetware