osism / issues

This repository is used for bug reports that are cross-project or not bound to a specific repository (or to an unknown repository).
https://www.osism.tech
1 stars 1 forks source link

[bug] `osism apply ceph` will apply ceph-mon to ceph-resource #1115

Open fzakfeld opened 2 weeks ago

fzakfeld commented 2 weeks ago

OSISM release version

7.1.2

What's the problem?

Detailed description of the problem

When running osism apply ceph (as opposed to osism apply ceph-mons etc...) 'ceph-mon' will be applied to the regular ceph nodes. Eventually it will fail because ceph-facts has not assigned a monitor_name to them:

...
TASK [ceph-mon : create monitor initial keyring] *******************************
changed: [ceph001]
changed: [ceph-mon01]
changed: [ceph002]
changed: [ceph-mon02]
changed: [ceph-mon03]
changed: [ceph003]
changed: [ceph004]
changed: [ceph006]

TASK [ceph-mon : copy the initial key in /etc/ceph (for containers)] ***********
changed: [ceph-mon01]
changed: [ceph-mon02]
changed: [ceph-mon03]
changed: [ceph001]
changed: [ceph002]
changed: [ceph003]
changed: [ceph004]
changed: [ceph006]

TASK [ceph-mon : create monitor directory] *************************************
fatal: [ceph001]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'monitor_name' is undefined. 'monitor_name' is undefined\n\nThe error appears to be in '/ansible/roles/ceph-mon/tasks/deploy_monitors.yml': line 70, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create monitor directory\n  ^ here\n"}
changed: [ceph-mon01]
changed: [ceph-mon02]
changed: [ceph-mon03]
fatal: [ceph002]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'monitor_name' is undefined. 'monitor_name' is undefined\n\nThe error appears to be in '/ansible/roles/ceph-mon/tasks/deploy_monitors.yml': line 70, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create monitor directory\n  ^ here\n"}
fatal: [ceph003]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'monitor_name' is undefined. 'monitor_name' is undefined\n\nThe error appears to be in '/ansible/roles/ceph-mon/tasks/deploy_monitors.yml': line 70, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create monitor directory\n  ^ here\n"}
fatal: [ceph004]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'monitor_name' is undefined. 'monitor_name' is undefined\n\nThe error appears to be in '/ansible/roles/ceph-mon/tasks/deploy_monitors.yml': line 70, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create monitor directory\n  ^ here\n"}
fatal: [ceph006]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'monitor_name' is undefined. 'monitor_name' is undefined\n\nThe error appears to be in '/ansible/roles/ceph-mon/tasks/deploy_monitors.yml': line 70, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create monitor directory\n  ^ here\n"}
...

Workaround: use individual roles.

References to existing reports

References to existing bug reports, mailing lists, ...

Severity

low

Urgency

low

berendt commented 2 weeks ago

Can you please share the relevant parts of your inventory/20-roles file.

fzakfeld commented 2 weeks ago

Sure,

##########################################################
# roles

# The "all" group is not used in OSISM. Therefore it is important
# that all nodes are explicitly listed here.
[generic]
manager01

[manager]
manager01

[monitoring]

[control]

[compute]

[network]

[ceph-control]

[ceph-resource]

[ceph-rgw:children]

And the ceph nodes (cephXXX) have the ceph-resource and generic, and the ceph-mons ceph-control and generic as netbox tags.

Some content from the generated hosts.yml:


dragon@75f8f098352c:~$ cat inventory/hosts.yml | grep ceph-resource -A4
        ceph-resource:
          hosts:
            ceph001:
              acme_client_lego: server lego {{ api_interface_address }}:{{ letsencrypt_webserver_port
                }}
...

dragon@75f8f098352c:~$ cat inventory/hosts.yml | grep ceph-control -A4
        ceph-control:
          hosts:
            ceph-mon01:
              acme_client_lego: server lego {{ api_interface_address }}:{{ letsencrypt_webserver_port
                }}
``
berendt commented 1 week ago

Looks like an error in the Netbox sync Script. I'll check this soon.