Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
869 B

9 years ago
  1. ---
  2. - block:
  3. - name: 'DEBIAN | install {{ service_name }}'
  4. apt:
  5. pkg: '{{ service_packages }}'
  6. state: 'present'
  7. update_cache: true
  8. cache_valid_time: 3600
  9. install_recommends: '{{ install_recommends | default("no") }}'
  10. tags:
  11. - 'packages'
  12. - name: 'DEBIAN | start {{ service_name }} at boot'
  13. service:
  14. name: '{{ service_name }}'
  15. enabled: true
  16. when: ansible_distribution != 'openwrt'
  17. - block:
  18. - name: 'OPENWRT | install {{ service_name }}'
  19. opkg:
  20. name: '{{ item }}'
  21. state: 'present'
  22. update_cache: true
  23. loop: '{{ service_packages|flatten(levels=1) }}'
  24. tags:
  25. - 'packages'
  26. - name: 'OPENWRT | start {{ service_name }} at boot'
  27. openwrt_init:
  28. name: '{{ service_name }}{{ "d" if service_name=="ssh" }}'
  29. enabled: true
  30. when: ansible_distribution == 'openwrt'