Skip to content

Instantly share code, notes, and snippets.

@pawarherschel
Created June 8, 2023 14:09
Show Gist options
  • Save pawarherschel/cfdcb14a30a262f08f596659c82f89f3 to your computer and use it in GitHub Desktop.
Save pawarherschel/cfdcb14a30a262f08f596659c82f89f3 to your computer and use it in GitHub Desktop.
---
- name: Enable internet services
hosts: serverb.lab.example.com
become: yes
tasks:
- name: Installs required packages
yum:
name:
- firewalld
- httpd
- mariadb-server
- php
- php-mysqlnd
state: latest
- name: Firewall service configuration
service:
name: firewalld
enabled: true
state: started
- name: firewalld config
firewalld:
service: http
permanent: true
immediate: true
state: enabled
- name: httpd and mariadb enabled and running
service:
name:
- httpd
- mariadb
state: started
enabled: true
- name: add entries for generating web content
get_url:
dest: /var/www/html/index.php
url: http://materials.example.com/labs/playbook-review/index.php
mode: 0644
- name: Test access to web server
hosts: localhost
become: false
tasks:
- name: Testing access
uri:
url: http://serverb.lab.example.com
return_code: 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment