فهرست منبع

Dummy directory is now created and ansible should enable and start fastd wich currently doesn't work

Till Klocke 10 سال پیش
والد
کامیت
915c27f3b6
3فایلهای تغییر یافته به همراه19 افزوده شده و 1 حذف شده
  1. 3 0
      roles/fastd/handlers/main.yml
  2. 6 1
      roles/fastd/tasks/main.yml
  3. 10 0
      test/integration/fastd/serverspec/test_spec.rb

+ 3 - 0
roles/fastd/handlers/main.yml

@@ -1,2 +1,5 @@
 ---
 # handlers file for fastd
+
+- name: Restart fastd
+  service: name=fastd state=restarted

+ 6 - 1
roles/fastd/tasks/main.yml

@@ -8,7 +8,7 @@
   when: ansible_distribution == "Debian"
 
 - name: Create fastd config directories
-  file: path=/etc/fastd/{{item.name}} state=directory recurse=yes
+  file: path=/etc/fastd/{{item.name}}/dummy state=directory recurse=yes
   with_items:
     - "{{fastd_instances}}"
 
@@ -16,8 +16,13 @@
   template: src=fastd.conf.j2 dest=/etc/fastd/{{item.name}}/fastd.conf
   with_items:
     - "{{fastd_instances}}"
+  notify: Restart fastd
 
 - name: Create fastd secrets
   template: src=secret.conf.j2 dest=/etc/fastd/{{item.name}}/secret.conf
   with_items:
     - "{{fastd_instances_secret}}"
+  notify: Restart fastd
+
+- name: fastd needs to autostart
+  service: name=fastd enabled=yes state=started

+ 10 - 0
test/integration/fastd/serverspec/test_spec.rb

@@ -7,6 +7,11 @@ describe package('fastd') do
   it { should be_installed }
 end
 
+# Ansible seems to have problems to enable a service. Needs investigation
+#describe service('fastd') do
+#  it { should be_enabled }
+#end
+
 describe package('rng-tools') do
   it { should be_installed }
 end
@@ -26,6 +31,11 @@ describe file('/etc/fastd/test') do
   it { should be_directory }
 end
 
+describe file('/etc/fastd/test/dummy') do
+  it { should exist }
+  it { should be_directory }
+end
+
 describe file('/etc/fastd/test/fastd.conf') do
   it { should exist }
   it { should be_file }