ansible-ipfs-cluster icon indicating copy to clipboard operation
ansible-ipfs-cluster copied to clipboard

Convert into ansible role (#9)

Open madoke opened this issue 4 years ago • 5 comments

Fixes #9:

  • Created the new directory structure and moved the files to it
  • Setup default variables previously on the group_vars
  • Implemented molecule test to validate role with docker image
  • Adapted the readme file with instructions on how to import the role, run the tests, and configure variables
  • Merged group_vars/README.md and host_vars/README.md with README.md
  • Bump default version of go-ipfs and ipfs-cluster to latest stable

New Directory structure

|-- LICENSE
|-- README.md
|-- defaults
|   `-- main.yml    # merges group-vars/ipfs.yml and group-vars/ipfs-cluster.yml
|-- handlers
|   `-- main.yml    # merges roles/ifps/handlers/main.yml and #roles/ipfs-cluster/handlers/main.yml
|-- meta
|   `-- main..yml    # new file, required to share role in ansible galaxy
|-- tasks   
|   |-- ipfs
|   |   `-- main.yml    # moved from roles/ipfs/tasks/main.yml
|   |-- ipfs-cluster
|   |   `-- main.yml    # moved from roles/ipfs-cluster/tasks/main.yml
|   `-- main.yml
|-- templates
|   |-- ipfs    # moved from roles/ipfs/templates
|   |   |-- etc
|   |   |   |-- init.d
|   |   |   |   `-- ipfs
|   |   |   `-- systemd
|   |   |       `-- system
|   |   |           `-- ipfs.service
|   |   `-- home
|   |       `-- ipfs
|   |           `-- ipfs_default_config
|   `-- ipfs-cluster # moved from roles/ipfs-cluster/templates
|       |-- etc
|       |   |-- init.d
|       |   |   `-- ipfs-cluster
|       |   `-- systemd
|       |       `-- system
|       |           `-- ipfs-cluster.service
|       |-- identity.json
|       |-- peerstore
|       `-- service.json
|-- molecule   # new directory for tests
|   |-- default
|       |-- molecule.yml
|       |-- verify.yml
|       `-- converge.yml
`-- vars

madoke avatar Jun 28 '21 22:06 madoke

Looking good

hsanjuan avatar Jun 29 '21 07:06 hsanjuan

Test setup done, role working properly. Still need to:

  • Update README (Add instructions on how to use the role and run the tests)
  • Finish the tests

madoke avatar Jun 30 '21 23:06 madoke

@madoke thanks for the work here, I am working on testing your changes here and plan to submit some feedback.

currently running into something on Ubuntu 20.04 where the ansible-ipfs-cluster : init IPFS step fails:

fatal: [<host>]: FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chmod: invalid mode: ‘A+user:ipfs:rx:allow’\nTry 'chmod --help' for more information.\n}). For information on working around this, see https://docs.ansible.com/ansible/2.11/user_guide/become.html#becoming-an-unprivileged-user"}

i got around it by installing acl (thru apt in my case).

rssnyder avatar Dec 21 '21 23:12 rssnyder

hey @rssnyder thanks for the efforts, i did use centos for my setup. I'll look into that over the next few days, as well as fixing the conflicts too. Cheers

madoke avatar Dec 23 '21 15:12 madoke

In the meantime, the molecule tests stopped working in the latest docker version (4.3.0) because of a change in cgroups that affects systemd. I suggest removing them or converting to vagrant for example (which im already doing on a separate branch)

madoke avatar Jan 07 '22 14:01 madoke