I get the below error. my_data is input data stored in the register. whats my_key?
fatal: [localhost]: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘my_key’ is undefined\n\nThe error appears to be in ‘/home/jenisha/PycharmProjects/ansible_ex/tasks/grep_ex.yml’: line 31, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - set_fact:\n ^ here\n”}
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an
undefined variable. The error was: 'my_key' is undefined\n\nThe error
appears to be in
'/home/jenisha/PycharmProjects/ansible_ex/tasks/grep_ex.yml': line 31,
Fix it. The code below works as expected. Mind the indentation.