in handlers/main.yml I've got:
- name: get API information for wp-config
uri:
url: "https://api.wordpress.org/secret-key/1.1/salt/"
return_contents: yes
register: api_info
The tasks I'm trying to run are:
- name: copy sample config file
copy:
src: /var/www/wordpress/wp-config-sample.php
dest: /var/www/wordpress/wp-config.php
remote_src: yes
notify: get API information for wp-config
- name: run API handler now
meta: flush_handlers
- name: insert unique key and salts in wp-config
lineinfile:
path: /var/www/wordpress/wp-config.php
regex: "put your unique phrase here"
insertafter: "put your unique phrase here"
line: "{{ api_info }}"
Unfortunately the value of variable api_info is not the content itself but:
{'status': 200, 'cookies': {}, 'date': 'Thu, 25 Oct 2018 14:53:42 GMT', 'url': 'https://api.wordpress.org/secret-key/1.1/salt/', 'transfer_encoding': 'chunked', 'changed': False, 'server': 'nginx', 'failed': False, 'connection': 'close', 'content_type': 'text/plain;charset=utf-8', 'msg': 'OK (unknown bytes)', 'redirected': False, 'x_frame_options': 'SAMEORIGIN', 'cookies_string': ''}
How can I get the actual content of the site?
Thanks in advance!