Download:
child 5:4b6b5454b6af
parent 3:862a025e0e2b
4:ae976b742c85
Anton Shestakov <av6@dwimlabs.net>, Sat, 20 Feb 2016 17:26:46 +0800
add an example playbook

1 файлов изменено, 35 вставок(+), 0 удалений(-) [+]
playbook-example.yml file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/playbook-example.yml Sat Feb 20 17:26:46 2016 +0800
@@ -0,0 +1,35 @@
+---
+- hosts: all
+ become: yes
+ vars:
+ hostname: mydomain
+ pre_tasks:
+ # NOTE: you probably don't want to run these 3 commands on a real box.
+ # Also, to be able to access hgweb from inside the box, you need to use
+ # domain name (i.e. http://127.0.0.1/ won't work). Make sure you have DNS
+ # records for hg.mydomain or add it to /etc/hosts.
+ - name: Set hostname
+ hostname: name={{ hostname }}
+ - name: Update /etc/hostname
+ shell: echo '{{ hostname }}' > /etc/hostname
+ - name: Update /etc/hosts
+ shell: echo '127.0.0.1 {{ hostname }}' >> /etc/hosts
+
+ # NOTE: this role depends on nginx and supervisor packages being installed,
+ # and also it uses two handlers:
+ # - reload supervisor
+ # - restart nginx
+ # If you don't have your own nginx and supervisor roles, just reload or
+ # restart both services manually after running this playbook.
+ - name: Install nginx
+ apt: package=nginx-full state=installed update_cache=yes cache_valid_time=3600
+ - name: Install supervisor
+ apt: package=supervisor state=installed
+ roles:
+# - role: nginx
+# tags: [nginx]
+# - role: supervisor
+# tags: [supervisor]
+ - role: hgweb
+ tags: [hgweb]
+...