Guest User

web plabook

a guest
Dec 29th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.81 KB | None | 0 0
  1. ---
  2. - hosts: web
  3.   become: yes
  4.   handlers:
  5.     - name: Restart Apache
  6.       service:
  7.         name: httpd
  8.         state: restarted
  9.       listen: "Restart Apache"
  10.   tasks:
  11.     - name: Install httpd
  12.       yum:
  13.         name: httpd
  14.         state: present
  15.     - name: Enable Service httpd
  16.       service:
  17.         name: httpd
  18.         state: started
  19.         enabled: yes
  20.     - name: Configure Website
  21.       lineinfile:
  22.         path: /etc/httpd/conf/httpd.conf
  23.         line: "ServerName repo.example.com:80"
  24.         line: "DocumentRoot /var/www/html/repo.example.com"
  25.         line: "NameVirtualHost 13.233.214.40:80"
  26.       when:
  27.        - ansible_hostname == "sv515c"
  28.       notify: "Restart Apache"
  29.     - name: Website.tgz
  30.       get_url:
  31.         url: http://repo.example.com
  32.         dest: /tmp/website.tgz
Add Comment
Please, Sign In to add comment