Interview Prep/Ansible/Roles, Collections and Galaxy

The play stops at `Validating arguments against arg spec main` with `missing required arguments: nginx_server_name`

IntermediateTroubleshootingRoles, Collections and Galaxy
Answer

Likely causes → The role has meta/argument_specs.yml, which marks nginx_server_name as required: true, and the caller did not provide it. This is the check doing its job.

Fix → Pass the value through group_vars, vars: on the role, or include_role. If the argument should be optional, give it a default in both argument_specs.yml and defaults/main.yml.

argument_specs:
  main:
    options:
      nginx_server_name:
        type: str
        required: true
        description: Public hostname for the vhost

Prevent → Keep the specs and defaults in sync. ansible-doc -t role -r roles nginx shows the documented interface.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy