Skip to content
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

Convert into ansible role (#9) #10

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

madoke
Copy link

@madoke madoke commented Jun 28, 2021

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 madoke changed the title WIP: Convert into ansible role WIP: Convert into ansible role (#9) Jun 28, 2021
@hsanjuan
Copy link
Owner

Looking good

@madoke
Copy link
Author

madoke commented Jun 30, 2021

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 madoke changed the title WIP: Convert into ansible role (#9) Convert into ansible role (#9) Jul 7, 2021
@madoke madoke mentioned this pull request Jul 7, 2021
@rssnyder
Copy link

@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).

@madoke
Copy link
Author

madoke commented Dec 23, 2021

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

@@ -15,3 +14,10 @@
name: ipfs
enabled: yes
state: restarted

- name: restart IPFS Cluster
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no reason to restart cluster just because IPFS role has run, is there?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't get this one. the handler is called only if there are tasks with notify: restart IPFS Cluster am I missing something ?

meta/main..yml Outdated Show resolved Hide resolved
molecule/default/molecule.yml Outdated Show resolved Hide resolved
templates/ipfs/etc/systemd/system/ipfs.service Outdated Show resolved Hide resolved
templates/ipfs/home/ipfs/ipfs_default_config Outdated Show resolved Hide resolved
@madoke
Copy link
Author

madoke commented Jan 7, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert to ansible role
4 participants