Deploy Jess Frazzelle's registry UI.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ceighlano 2f77a15f85 Deleting git_repository_extra_path vars as is not more being used 10 months ago
defaults Deleting git_repository_extra_path vars as is not more being used 10 months ago
meta Adding list in meta/main.yml 10 months ago
molecule/default Linting change in molecule playbooks 10 months ago
tasks Changing conditionals to pass linting in tasks 10 months ago
templates [wip] add auth and write the remote_build tasks 1 year ago
.gitignore [WIP] not ready yet 1 year ago
.yamllint [WIP] not ready yet 1 year ago
LICENSE Initial commit 1 year ago
README.md * Update readme 1 year ago

README.md

Deploy Jess Frazzelle UI registry

Deploy UI registry. It’s really a copy of the deploy-docker role, but it adds the social user in the UI.

Requirements

  • Pip installed on host
  • Docker installed on the host
  • Docker installed on the device that is running ansible
  • A registry where you can log in

Role Variables

  • git_repository: The repository in which the dockerfile is located.
  • git_repository_destination: Local path in which to clone the git repository.
  • git_repository_tag: Version to use of the git repository.
  • git_repository_extra_path: Extra path inside the cloned repo to the directory containing the Dockerfile
  • service_name: Name of the systemd service.
  • docker_registry: Domain of the registry with write access.
  • docker_registry_read: Domain of the registry with read access.
  • registry_user: User used to authenticate with the registry.
  • registry_password: Password used to authenticate with the registry.
  • docker_tag: Docker tag.
  • docker_command: Docker command used to launch the container.
  • social_user: Social URL to to show in the UI.
  • remote_build: Whether to build the docker remotely or locally [Default: False]

Dependencies

None.

Example Playbook

- hosts: servers
  vars:
    social_user: <a href="https://social.daemons.it/drymer">@drymer</a>
    git_repository: https://github.com/jessfraz/reg
    git_repository_destination: /home/drymer/Proyectos/daemons/docker/ui-reg
    git_repository_extra_path: server
    git_repository_tag: v0.9.0
    service_name: ui-registry
    docker_registry: r.daemons.it
    docker_registry_read: registry.daemons.it
    registry_user: drymer
    registry_password: lVtGTi7X5igQGKy3qB1j
    docker_tag: "{{ git_repository_tag }}"
    docker_command: /usr/bin/docker run --rm --name "{{ service_name }}" -i -p 8080:8080 "{{ docker_registry_read }}/{{ service_name }}" --username "{{ registry_user }}" -p "{{ registry_password }}" --insecure --registry "{{ docker_registry_read }}"
  roles:
    - { role: deploy-docker}

Testing

To test the role you need molecule.

And vagrant installed with libvirt

The idempotence is very wrong, there are a lot of changed_when: False, ugly, really ugly, but I don’t have more time to test it.

Also I’m having troubles connecting the ui interface with the registry, as noted on this bug. One possibility would be to bring up a nginx docker that does the proxy, but you would need a valid https certificate…

I give up on the tests till jess answers…

I’ve tried to test the construction of the docker in one machine and installing the service in other, but local_action or delegate_to are little fuckers to simulate.

The delegate_to approach fails because it tries to ssh back with no user, so it doesn’t matter if you copy the ssh keys there it will keep on failing.

Another approach I took was to copy all the structure of the role on the machine building the docker and modify the molecule/default/playbook.yml so as to run the playbook from there so the local_action works. The problem is that you have to run the playbook on a command so you are forced to use the changed_when: false therefore not testing the idempotence of the rol.

I give up on trying to test this role with the option remote_build = False. If anyone is interested I left my trails on:

  • molecule/default/molecule.yml
  • molecule/default/playbook.yml

Therefore the default case is for remote_build == True if you feel strong enough to test the other case, please make a new molecule scenery.

molecule test

License

GPL3

Author Information

drymer [ EN ] autistici.org lyz [ EN ] riseup.net