Skip to content

Convert into ansible role (#9)#10

Open
madoke wants to merge 24 commits into
hsanjuan:masterfrom
madoke:master
Open

Convert into ansible role (#9)#10
madoke wants to merge 24 commits into
hsanjuan:masterfrom
madoke:master

Conversation

@madoke

@madoke madoke commented Jun 28, 2021

Copy link
Copy Markdown

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
Copy Markdown
Owner

Looking good

@madoke

madoke commented Jun 30, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown

@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

madoke commented Dec 23, 2021

Copy link
Copy Markdown
Author

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

Comment thread handlers/main.yml
enabled: yes
state: restarted

- name: restart IPFS Cluster

Copy link
Copy Markdown
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
Copy Markdown
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 ?

Comment thread meta/main..yml Outdated
Comment thread molecule/default/molecule.yml Outdated
Comment thread templates/ipfs/etc/systemd/system/ipfs.service
Comment thread templates/ipfs/home/ipfs/ipfs_default_config Outdated
@madoke

madoke commented Jan 7, 2022

Copy link
Copy Markdown
Author

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)

mig5 added 4 commits August 28, 2025 09:35
…er variables. Change GracePeriod to an optional variable too
Add default values for ipfs_connmgr_low_water / ipfs_connmgr_high_water variables. Change GracePeriod to an optional variable too
On a system with umask 027, the version-specific kubo folder
and its subfolder are not accessible to the 'ipfs' user, and
ipfs won't start. Enforce 0755 on these folders.
Fix permissions on kubo subfolders.
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