meza icon indicating copy to clipboard operation
meza copied to clipboard

Fix `meza delete elasticsearch`

Open jamesmontalvo3 opened this issue 6 years ago • 0 comments

Environment

  • Machine or Virtual Machine details: Vagrant
  • Operating System: CentOS Linux release 7.6.1810 (Core)
  • meza version hash: Discovered on 32.x branch. May be elsewhere. Commit = 6808555

Issue details

Command to delete elasticsearch is: sudo meza delete elasticsearch <environment-name>. This fails due to not properly loading all meza variables before running. Error is:

The task includes an option with an undefined variable. The error was: 'm_meza_data' is undefined

The error appears to have been in '/opt/meza/src/playbooks/delete-elasticsearch.yml': line 23, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


    - name: Remove {{ m_meza_data }}/elasticsearch
      ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}"

Adding the following as the first task in src/playbooks/delete-elasticsearch.yml solves the problem:

  tasks:
    - include_role:
        name: set-vars

jamesmontalvo3 avatar Jan 18 '19 22:01 jamesmontalvo3