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.
ceighlander f4afdfe0cd Merge branch 'feature/upgrading-stack' of ansible-roles/ui-registry into master 5 months ago
defaults Deleting git_repository_extra_path vars as is not more being used 5 months ago
meta Adding list in meta/main.yml 5 months ago
molecule/default Linting change in molecule playbooks 5 months ago
tasks Changing conditionals to pass linting in tasks 5 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
CHANGELOG.md Adding Changelog to changelog file 5 months ago
LICENSE Initial commit 1 year ago
README.md Quit little joke in README 5 months ago

README.md

Deploy Jess Frazzelle UI registry

Deploy UI registry. It’s quite similar to deploy-docker role but not exactly the same.

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.
  • 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.
  • remote_build: Whether to build the docker remotely or locally [Default: False]

Dependencies

None.

Example Playbook

- hosts: servers
  vars:
    git_repository: https://github.com/genuinetools/reg
    git_repository_destination: /home/drymer/Proyectos/daemons/docker/ui-reg
    git_repository_tag: v0.16.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 }}" server --username "{{ registry_user }}" -p "{{ registry_password }}" --force-non-ssl --registry "{{ docker_registry_read }}"
  roles:
    - { role: ui-registry }

Testing

To test the role you need molecule.

And vagrant installed with libvirt

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 arleking [EN] protonmail.com