Now that we have everything in place to install WordPress, we can make a start, first by setting some default variables in roles/wordpress/defaults/main.yml:
wordpress: domain: "http://{{ ansible_nodename }}/" title: "WordPress installed by Ansible" username: "ansible" password: "password" email: "test@example.com" theme: "sydney" plugins: - "jetpack" - "wp-super-cache" - "wordpress-seo" - "wordfence" - "nginx-helper"
Now that we have our variables, we can start our download if we need to:
- name: are the wordpress files already there? stat: path: "{{ wordpress_system.home }}/index.php" register: wp_installed- name: download wordpresss shell: "{{ wp_cli.path }} core download" args: chdir: ...