---
 - name: transfer envoyinstack install package to remote host and unarchive to /tmp/
   unarchive:
    src: "{{ envoyinstack_dir }}/envoyinstack.tgz"
    dest: /tmp/

 - name: config file [/etc/hosts]
   shell: /tmp/envoyinstack/include/hosts.sh

 - name: install mysql 
   shell: bash /tmp/envoyinstack/install.sh --db_option {{ mysql_option }} --dbinstallmethod 1 
   register: res
   failed_when: "'successfully' not in res.stdout"

 - name: config file [/etc/my.cnf]
   import_tasks: common/config_file.yaml

 - name: show install mysql info
   debug:
     msg: "{{res.stdout_lines|regex_replace(('\\\\x1b\\[(\\w+)(;\\d+)?m|(\\\\)'),'') }}" 
     verbosity: 0

 - name: restart mysqld
   service: name=mysqld state=restarted

