tsuna-server / build-server-ansible

1 stars 0 forks source link

Failed due to undefined variable "primary_group_name". Current node "dev-swift01" must belonging in "cinders" or "storages" or "comstorages" or "computes" #117

Open TsutomuNakamura opened 12 months ago

TsutomuNakamura commented 12 months ago

When there are some swift nodes in an inventory, an error below will be occurred.

TASK [functions : Declare primary_group_name as "controllers"] ****
skipping: [dev-swift01]
skipping: [dev-swift02]
skipping: [dev-swift03]

TASK [functions : Check whether a variable "primary_group_name" has declared] ****
fatal: [dev-swift01]: FAILED! => {"changed": false, "msg": "Failed due to undefined variable \"primary_group_name\". Current node \"dev-swift01\" must belonging in \"cinders\" or \"storages\" or \"comstorages\" or \"computes\"."}
fatal: [dev-swift02]: FAILED! => {"changed": false, "msg": "Failed due to undefined variable \"primary_group_name\". Current node \"dev-swift02\" must belonging in \"cinders\" or \"storages\" or \"comstorages\" or \"computes\"."}
fatal: [dev-swift03]: FAILED! => {"changed": false, "msg": "Failed due to undefined variable \"primary_group_name\". Current node \"dev-swift03\" must belonging in \"cinders\" or \"storages\" or \"comstorages\" or \"computes\"."}

PLAY RECAP ****
...
TsutomuNakamura commented 12 months ago

This error has occurred when this scenario include ./roles/functions/tasks/declare_variable_primary_group_name/main.yml from ./roles/storage_common/tasks/main.yml.

https://github.com/tsuna-server/build-server-ansible/blob/666f261940e09744b6351146eaf514ce8f138a8d/roles/storage_common/tasks/main.yml#L1-L5

TsutomuNakamura commented 12 months ago

And I found that ./roles/ceph/tasks/main.yml has duplicated instruction to declare a variable primary_group_name.

https://github.com/tsuna-server/build-server-ansible/blob/666f261940e09744b6351146eaf514ce8f138a8d/roles/ceph/tasks/main.yml#L14-L42

It should be replaced an instruction including ./roles/functions/tasks/declare_variable_primary_group_name/main.yml.