galaxyproject / ansible-cvmfs

An Ansible role for installing and configuring CernVM-FS (CVMFS)
12 stars 17 forks source link

/etc/cvmfs/repositories.d directory doesn't exist on cvmfs_role of "client". Ansible fails on options.yml #38

Closed deano2point0 closed 2 years ago

deano2point0 commented 3 years ago

When running this role on a node with cvmfs_role of "client" it fails when it gets to the lineinfile module in options.yml as there is no /etc/cvmfs/repositories.d directory or contents on the node. I have read through the tasks file and I can't see anything that would create these files on a client. Am I missing something, or is this broken?

hexylena commented 3 years ago

What OS are you using? We hadn't seen this error before and a lot of us are using this role in client mode.

deano2point0 commented 3 years ago

The client I am running this on is CentOS 7.

deano2point0 commented 3 years ago

The play I'm using is based on the one given in the examples in the readme for creating your own infrastructure. I have replaced all the variables (domain URLs etc ) with the values for my environment - added the keys that were created on the first run - set hosts to all. Stratum0 server built fine and works, just the client failing as described.

- name: CVMFS
  hosts: cvmfsstratum0servers
  vars:
    cvmfs_numfiles: 4096
    cvmfs_server_urls:
      - domain: example.org
        urls:
          - "http://cvmfs0.example.org/cvmfs/@fqrn@"
    cvmfs_repositories:
      - repository: foo.example.org
        stratum0: cvmfs0.example.org
        key_dir: /etc/cvmfs/keys/example.org
        server_options:
          - CVMFS_AUTO_TAG=false
          - CVMFS_GARBAGE_COLLECTION=true
          - CVMFS_AUTO_GC=false
        client_options:
          - CVMFS_NFILES=4096
      - repository: bar.example.org
        stratum0: cvmfs0.example.org
        key_dir: /etc/cvmfs/keys/example.org
  roles:
    - galaxyproject.cvmfs
hexylena commented 3 years ago

maybe @natefoo has some input here, I'm going into summer holidays for the next month sorry.

deano2point0 commented 3 years ago

No problem, have a nice Holiday!

natefoo commented 3 years ago

Is /etc/cvmfs created at all? It should either be when the cvmfs-config-default package is installed or when cvmfs_config setup runs here.

deano2point0 commented 3 years ago

Hi, Yes /etc/cvmfs exists, but there is no 'repositories.d' directory inside it.

natefoo commented 3 years ago

It looks like repositories.d would be created for servers but not clients - this probably hasn't come up before because setting client options on clients is not very common (servers are both servers and clients, and this is the case where client options are most commonly used). I'm a bit confused as your example playbook is for Stratum 0 servers, not clients, but I've created #39 that should fix the issue for you.