Playbook Update Apache: Difference between revisions

From RoggeWiki
Jump to navigation Jump to search
(Created page with "--- - hosts: webservers vars: http_port: 80 max_clients: 200 remote_user: root tasks: - name: ensure apache is at the latest version yum: name=httpd state=...")
 
No edit summary
 
Line 1: Line 1:
---
---
- hosts: webservers
- hosts: webservers
  vars:
  vars:
    http_port: 80
    http_port: 80
    max_clients: 200
    max_clients: 200
  remote_user: root
  remote_user: root
  tasks:
  tasks:
  - name: ensure apache is at the latest version
  - name: ensure apache is at the latest version
    yum: name=httpd state=latest
    yum: name=httpd state=latest
  - name: write the apache config file
  - name: write the apache config file
    template: src=/srv/httpd.j2 dest=/etc/httpd.conf
    template: src=/srv/httpd.j2 dest=/etc/httpd.conf
    notify:
    notify:
    - restart apache
    - restart apache
  - name: ensure apache is running (and enable it at boot)
  - name: ensure apache is running (and enable it at boot)
    service: name=httpd state=started enabled=yes
    service: name=httpd state=started enabled=yes
  handlers:
  handlers:
    - name: restart apache
    - name: restart apache
      service: name=httpd state=restarted
      service: name=httpd state=restarted

Latest revision as of 08:22, 27 September 2016

---
- hosts: webservers
  vars:
    http_port: 80
    max_clients: 200
  remote_user: root
  tasks:
  - name: ensure apache is at the latest version
    yum: name=httpd state=latest
  - name: write the apache config file
    template: src=/srv/httpd.j2 dest=/etc/httpd.conf
    notify:
    - restart apache
  - name: ensure apache is running (and enable it at boot)
    service: name=httpd state=started enabled=yes
  handlers:
    - name: restart apache
      service: name=httpd state=restarted