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

"is_reinstall_mode" is undefined doing "cikit reinstall" #58

Closed
BR0kEN- opened this issue Nov 1, 2017 · 2 comments
Closed

"is_reinstall_mode" is undefined doing "cikit reinstall" #58

BR0kEN- opened this issue Nov 1, 2017 · 2 comments
Assignees
Labels

Comments

@BR0kEN-
Copy link
Owner

BR0kEN- commented Nov 1, 2017

vagrant@test:~$ cikit reinstall

PLAY [localhost] *******************************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Set path to directory, where project accessible from web] ********************************************************************************************************************************************
ok: [localhost]

TASK [Set path to directory, where project codebase located] ***********************************************************************************************************************************************
ok: [localhost]

TASK [Set path to reports directory and URL by which they will be accessible] ******************************************************************************************************************************
ok: [localhost]

TASK [Ensure that project directory has correct permissions] ***********************************************************************************************************************************************
ok: [localhost] => (item=/var/www/docroot)
ok: [localhost] => (item=/var/www/docroot/reports)
changed: [localhost] => (item=/var/www/docroot/sites/default)

TASK [Initialize an empty build report] ********************************************************************************************************************************************************************
ok: [localhost]

TASK [Check installation of Composer packages] *************************************************************************************************************************************************************
ok: [localhost]

TASK [Check for composer.json existence] *******************************************************************************************************************************************************************
ok: [localhost]

TASK [Install Composer packages] ***************************************************************************************************************************************************************************

TASK [Check existence of installation mode] ****************************************************************************************************************************************************************
ok: [localhost]

TASK [Check existence of environment configuration] ********************************************************************************************************************************************************
ok: [localhost]

TASK [Obtain home directory of a user, who triggered this script] ******************************************************************************************************************************************
changed: [localhost]

TASK [Set the user's home directory] ***********************************************************************************************************************************************************************
ok: [localhost]

TASK [Ensure directory for backup data exists] *************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "gid": 80, "group": "80", "mode": "0777", "msg": "chown failed: [Errno 1] Operation not permitted: '/var/www/backup'", "owner": "501", "path": "/var/www/backup", "size": 68, "state": "directory", "uid": 501}
...ignoring

TASK [Seek for SSH keys] ***********************************************************************************************************************************************************************************
ok: [localhost]

TASK [Copy SSH keys] ***************************************************************************************************************************************************************************************

TASK [include_vars] ****************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Compute actions to run] ******************************************************************************************************************************************************************************
ok: [localhost] => (item=composer)
ok: [localhost] => (item=npm)

TASK [include_tasks] ***************************************************************************************************************************************************************************************
included: /var/www/scripts/tasks/reinstall/actions/packages-install.yml for localhost

TASK [include_tasks] ***************************************************************************************************************************************************************************************
included: /var/www/scripts/tasks/reinstall/actions/cache-get.yml for localhost

TASK [Check for Composer packages in cache] ****************************************************************************************************************************************************************
ok: [localhost]

TASK [Check for Composer packages at place] ****************************************************************************************************************************************************************
ok: [localhost]

TASK [Check whether Composer packages should be reinstalled] ***********************************************************************************************************************************************
ok: [localhost]

TASK [Copy Composer packages from cache] *******************************************************************************************************************************************************************

TASK [Check for /var/www/docroot/composer.json] ************************************************************************************************************************************************************
ok: [localhost]

TASK [Install Composer packages] ***************************************************************************************************************************************************************************

TASK [include_tasks] ***************************************************************************************************************************************************************************************

TASK [include_tasks] ***************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "reason": "'is_reinstall_mode' is undefined"}

PLAY RECAP *************************************************************************************************************************************************************************************************
localhost                  : ok=22   changed=2    unreachable=0    failed=1
  • If we put - debug: var=is_reinstall_mode right before the include_tasks the correct value of the variable will be shown.
  • If we remove the condition and will do just - include_tasks: "tasks/reinstall/modes/full.yml" the new error will appear:
fatal: [localhost]: FAILED! => {"failed": true, "msg": "The task includes an option with an undefined variable. The error was: 'state' is undefined\n\nThe error appears to have been in '/var/www/scripts/tasks/database/database.yml': line 2, 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: \"{{ name | default('command') }}\"\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'state' is undefined"}
@BR0kEN- BR0kEN- added the bug label Nov 1, 2017
@BR0kEN- BR0kEN- self-assigned this Nov 1, 2017
@BR0kEN-
Copy link
Owner Author

BR0kEN- commented Nov 1, 2017

The problem is solving by replacing all import_tasksby include_tasks in full.yml. Seems import_tasks cannot live inside of a file which has been included using include_tasks.

@BR0kEN-
Copy link
Owner Author

BR0kEN- commented Nov 1, 2017

What is strange that the error report indicates the variable is undefined when the underlying problem is far deeper.

@lokeoke lokeoke closed this as completed Nov 2, 2017
BR0kEN- added a commit that referenced this issue Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants