Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of unresolved values #279

Open
profiprog opened this issue Nov 12, 2020 · 0 comments
Open

Validation of unresolved values #279

profiprog opened this issue Nov 12, 2020 · 0 comments

Comments

@profiprog
Copy link

Environment

  • Extension version: v0.5.2
  • OS Type: MacOS

Summary

There is reported problem for playbook where value should an enum constant,
but actually is a template expression.

Reproduce steps

Let's have playbook.yml with this tasks:

  - name: mysql - configure
    become: yes
    copy:
      dest: /etc/mysql/mysql.conf.d/o_custom.cnf
      content: |
        [mysqld]
        lower_case_table_names=1
        default-storage-engine=InnoDB
    register: mysql_config
  - name: mysql - start/restart
    become: yes
    service:
      name: mysql
      state: '{{"restarted" if mysql_config.changed else "started"}}'

At last line is reported problem because value should be one of "reloaded", "restarted", "started", "stopped",
but there is a template which should resolve the valid value.

Expected Results

No problem reporting. Just skip this kind of validation when template is detected.

Actual Results

Value is not accepted. Valid values: "reloaded", "restarted", "started", "stopped".

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

No branches or pull requests

1 participant