mysqld_instance:
- name: "HOSTNAME"
port:
- '3307'
user: 'mysql'
mysql_data_path: '/opt/mysql'
mysql_data_tree:
- { file: 'run', mode: '755' }
- { file: 'var', mode: '755' }
- { file: 'var/log', mode: '755' }
- { file: 'var/data', mode: '755' }
- { file: 'var/tmp', mode: '755' }
- { file: 'var/iblogs', mode: '755' }
- { file: 'var/ibdata', mode: '755' }
- name: "Create MySQL Tree"
file:
path: "{{ item.0.mysql_data_path }}/{{ item.1 }}/{{ item.2.file }}"
owner: "{{ item.0.user }}"
group: "{{ item.0.user }}"
mode: "{{ item.1.mode }}"
state: directory
with_subelements:
- "{{ mysqld_instance }}"
- port
- mysql_data_tree
fatal: [XXXXXXXXXXXXXXXXXXXX]: FAILED! => {"failed": true, "msg": "subelements lookup expects a list of two or three items, the optional third item must be a dict with flags skip_missing"}
Arf, and do you have an idea of how I Could make this with other function/module ?
Good job, but I did not really want to change ansible sources :/