ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 392 forks source link

Provide variable manager and loader to cache inspector #861

Closed j00bar closed 6 years ago

j00bar commented 6 years ago
ISSUE TYPE
SUMMARY

Fixes #858 by making the role cache checker use Ansible primitives properly.

# container.yml
version: "2"
settings:
  conductor:
    base: centos:7
  project_name: i858
services:
  test:
    from: centos:7
    roles:
      - i858

# roles/i858/tasks/main.yml
---
- debug: msg=main
- include_tasks: "other.yml"

# roles/i858/tasks/other.yml
---
- debug: msg=included

$ ansible-container --devel build --no-cache
Building Docker Engine context...   
Starting Docker build of Ansible Container Conductor image (please be patient)...
Parsing conductor CLI args.
Copying build context into Conductor container.
Docker™ daemon integration engine loaded. Build starting.   project=i858
Building service... project=i858 service=test
Fingerprint for this layer: 043ab19711de4e7d57ba55d54598b92e9c7219c0b40fe5de73f0078d48f791ef    parent_fingerprint=7ad9462067e7decb4b90d672399ca17f02fd05c011bc31ec275bcffc4a189e52 parent_image_id=sha256:ff426288ea903fcf8d91aca97460c613348f7a27195606b45f19ae91776ca23d role=i858 service=test
Applying role i858 on image sha256:ff426288ea903fcf8d91aca97460c613348f7a27195606b45f19ae91776ca23d as container i858_test-7ad94620-i858    service=test

PLAY [test] ********************************************************************

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

TASK [i858 : debug] ************************************************************
ok: [test] => {
    "msg": "main"
}

TASK [i858 : include_tasks] ****************************************************
included: /src/roles/i858/tasks/other.yml for test

TASK [i858 : debug] ************************************************************
ok: [test] => {
    "msg": "included"
}

PLAY RECAP *********************************************************************
test                       : ok=4    changed=0    unreachable=0    failed=0

Applied role to service role=i858 service=test
Committed layer as image    fingerprint=043ab19711de4e7d57ba55d54598b92e9c7219c0b40fe5de73f0078d48f791ef image=sha256:898fc3f001477007c49b877615f7f501f68a13b74f88d319f78a58837e31447f role=i858 service=test
Build complete. service=test
Cleaning up stale build artifacts.  service=test
All images successfully built.
Conductor terminated. Cleaning up.  command_rc=0 conductor_id=4752011b0874a27392593e71955419f7077351f1647e39b227d36b6f1ca2a76c save_container=False