Ensure that Drupal site directories are present
This commit is contained in:
parent
53521f0e93
commit
ecb4c7a608
|
@ -1,2 +1,2 @@
|
|||
---
|
||||
# defaults file for opdavies.drupal-settings
|
||||
drupal_settings: []
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
drupal_settings:
|
||||
- root: /var/www/test
|
||||
sites:
|
||||
- name: default
|
||||
roles:
|
||||
- role: opdavies.drupal-settings
|
||||
|
|
|
@ -5,10 +5,8 @@ import testinfra.utils.ansible_runner
|
|||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
def test_drupal_site_directory_exists(host):
|
||||
directory = host.file('/var/www/test/sites/default')
|
||||
|
||||
def test_hosts_file(host):
|
||||
f = host.file('/etc/hosts')
|
||||
|
||||
assert f.exists
|
||||
assert f.user == 'root'
|
||||
assert f.group == 'root'
|
||||
assert directory.exists
|
||||
assert directory.is_directory
|
||||
|
|
|
@ -1,2 +1,8 @@
|
|||
---
|
||||
# tasks file for opdavies.drupal-settings
|
||||
- name: Ensure that Drupal site directories are present
|
||||
file:
|
||||
state: directory
|
||||
path: '{{ item.0.root }}/sites/{{ item.1.name|default("default") }}'
|
||||
with_subelements:
|
||||
- '{{ drupal_settings }}'
|
||||
- sites
|
||||
|
|
Reference in a new issue