Ansible with Docker Flashcards

1
Q

What features make Ansible more amenable to Docker?

A

1) Docker remote API: simplifies automation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does Docker simplifies working with Docker?

A

1) Orchestration

2) Provisioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why use Ansible for with Docker?

A

1) Dockerfiles work fine for simple images.
2) Complex processes, Ansible is a better fit
3) Allows you to reuse your existing Ansible roles and standardize across the company
4) Supports deploying to Kubernetes and OpenShift

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What module is used to manipulate docker images with Ansible?

A

docker_container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Provide ansible command for download an image from docker registry

A

> ansible -m docker_container -a “name=test-ghost image=ghost ports=8000:2368”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Provide Ansible command for removing an image from local storage

A

> ansible -m docker_container -a “name=test-ghost state=absent”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Sketch the task for creating an nginx image with config file config/nginx.conf

A
  • name: cresate nginx image
    docker_image:
    name: config/nginx.conf
    path: nginx
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What happen with ansible_image module if I run the create image task twice?

A

The second time will do nothing if the image was created the first time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

I want to ensure that if I run the task for creating an image the second time, a new image will be created. What do I have to do if anything?

A

add force: true to the task when running it the second time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the recommended way for creating images when change happen?

A

1) Do not override the previous image with force:true

2) Instead create a new image with a different tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do I log in into docker registry from Ansible?

A

Use docker_login module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do I gather facts on a locally stored image?

A

Use docker_image_facts module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you create a network for connecting containers with snsible?

A

docker_network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the docker inventory plugin?

A

Docker inventory plugin is a plugin that allows ansible to talk to the docker daemon and build an inventory dynamically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly