New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify `build` command line: accept target image metadata in a file #10

Open
TomasTomecek opened this Issue Oct 31, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@TomasTomecek
Copy link
Owner

TomasTomecek commented Oct 31, 2018

Started by @jcgruenhage.

My idea is to store the metadata in an ansible variable, the variable is a dict:

- hosts: all
  vars:
    ansible_bender:
      base_image: fedora:28
      target_image:
        name: asdqwe
        environment:
          X: Y
        labels:
          ...
      working_container:
        user: 12345
        volumes:
        - { src: /path/to/my/code, dest: /src:Z }
tasks:
  ...

The main problem with this is that ab would need to read those variables, so they can't contain any jinja. Not sure if ansible is able to process them and output in some way. On the other hand, we could probably have an ansible plugin which would read those vars and then magically create and initiate the container.

@jcgruenhage

This comment has been minimized.

Copy link

jcgruenhage commented Oct 31, 2018

ansible can definitely process and output them, worst case it would require a debug task in the playbook

@TomasTomecek

This comment has been minimized.

Copy link
Owner

TomasTomecek commented Oct 31, 2018

@jcgruenhage that's actually a pretty good idea: ab could copy and edit the playbook, add that debug task to figure out output. Luckily I have two of the Ansible core devs in the office so I might ask them what would be the best way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment