summaryrefslogtreecommitdiff
path: root/lamp
diff options
context:
space:
mode:
Diffstat (limited to 'lamp')
-rw-r--r--lamp/README.md38
-rw-r--r--lamp/defaults/main.yml5
-rw-r--r--lamp/handlers/main.yml7
-rw-r--r--lamp/meta/main.yml53
-rw-r--r--lamp/tasks/Debian-phpmyadmin.yml24
-rw-r--r--lamp/tasks/RedHat-phpmyadmin.yml23
-rw-r--r--lamp/tasks/clean_dbuser.yml13
-rw-r--r--lamp/tasks/main.yml57
-rw-r--r--lamp/tasks/test_dbuser.yml19
-rw-r--r--lamp/templates/index.j220
-rw-r--r--lamp/tests/inventory2
-rw-r--r--lamp/tests/test.yml5
-rw-r--r--lamp/vars/Debian.yml14
-rw-r--r--lamp/vars/RedHat.yml14
-rw-r--r--lamp/vars/main.yml2
15 files changed, 0 insertions, 296 deletions
diff --git a/lamp/README.md b/lamp/README.md
deleted file mode 100644
index 225dd44..0000000
--- a/lamp/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-Role Name
-=========
-
-A brief description of the role goes here.
-
-Requirements
-------------
-
-Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
-
-Role Variables
---------------
-
-A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
-
-Dependencies
-------------
-
-A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
-
-Example Playbook
-----------------
-
-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
-
- - hosts: servers
- roles:
- - { role: username.rolename, x: 42 }
-
-License
--------
-
-BSD
-
-Author Information
-------------------
-
-An optional section for the role authors to include contact information, or a website (HTML is not allowed).
diff --git a/lamp/defaults/main.yml b/lamp/defaults/main.yml
deleted file mode 100644
index 67be7ae..0000000
--- a/lamp/defaults/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-# vars file for lamp
-
-db_user: toto
-db_passwd: secret
diff --git a/lamp/handlers/main.yml b/lamp/handlers/main.yml
deleted file mode 100644
index b583d01..0000000
--- a/lamp/handlers/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-# handlers file for lamp
-- name: restarting_apache
- service:
- name: '{{apache.service}}'
- state: restarted
-
diff --git a/lamp/meta/main.yml b/lamp/meta/main.yml
deleted file mode 100644
index 227ad9c..0000000
--- a/lamp/meta/main.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-galaxy_info:
- author: your name
- description: your role description
- company: your company (optional)
-
- # If the issue tracker for your role is not on github, uncomment the
- # next line and provide a value
- # issue_tracker_url: http://example.com/issue/tracker
-
- # Choose a valid license ID from https://spdx.org - some suggested licenses:
- # - BSD-3-Clause (default)
- # - MIT
- # - GPL-2.0-or-later
- # - GPL-3.0-only
- # - Apache-2.0
- # - CC-BY-4.0
- license: license (GPL-2.0-or-later, MIT, etc)
-
- min_ansible_version: 2.9
-
- # If this a Container Enabled role, provide the minimum Ansible Container version.
- # min_ansible_container_version:
-
- #
- # Provide a list of supported platforms, and for each platform a list of versions.
- # If you don't wish to enumerate all versions for a particular platform, use 'all'.
- # To view available platforms and versions (or releases), visit:
- # https://galaxy.ansible.com/api/v1/platforms/
- #
- # platforms:
- # - name: Fedora
- # versions:
- # - all
- # - 25
- # - name: SomePlatform
- # versions:
- # - all
- # - 1.0
- # - 7
- # - 99.99
-
- galaxy_tags: []
- # List tags for your role here, one per line. A tag is a keyword that describes
- # and categorizes the role. Users find roles by searching for tags. Be sure to
- # remove the '[]' above, if you add tags to this list.
- #
- # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
- # Maximum 20 tags per role.
-
-dependencies: []
- # List your role dependencies here, one per line. Be sure to remove the '[]' above,
- # if you add dependencies to this list.
- \ No newline at end of file
diff --git a/lamp/tasks/Debian-phpmyadmin.yml b/lamp/tasks/Debian-phpmyadmin.yml
deleted file mode 100644
index 9da9a1b..0000000
--- a/lamp/tasks/Debian-phpmyadmin.yml
+++ /dev/null
@@ -1,24 +0,0 @@
----
-- name: configuration debconf
- debconf:
- name: phpmyadmin
- question: 'phpmyadmin/reconfigure-webserver'
- value: 'apache2'
- vtype: select
-- name: configuration debconf
- debconf:
- name: phpmyadmin
- question: 'phpmyadmin/mysql/admin-pass'
- value: '(password omitted)'
- vtype: string
-- name: configuration debconf
- debconf:
- name: phpmyadmin
- question: 'phpmyadmin/dbconfig-install'
- value : 'true'
- vtype: boolean
-
-- name: installation phpmyadmin
- package:
- name: phpmyadmin
- state: present
diff --git a/lamp/tasks/RedHat-phpmyadmin.yml b/lamp/tasks/RedHat-phpmyadmin.yml
deleted file mode 100644
index 569ddd2..0000000
--- a/lamp/tasks/RedHat-phpmyadmin.yml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-- name: installation epel-release
- package:
- name: epel-release
- state: present
-
-- name: installation phpmyadmin
- package:
- name: phpmyadmin
- state: present
-
-- name: phpmyadmin.conf
- replace:
- path: /etc/httpd/conf.d/phpMyAdmin.conf
- regexp: "Require local"
- replace: "Require all granted"
- after: "<Directory /usr/share/phpMyAdmin/>"
- before: "</Directory>"
- notify: restarting_apache
-
-- name: database
- shell: mysql < /usr/share/phpMyAdmin/sql/create_tables.sql
-
diff --git a/lamp/tasks/clean_dbuser.yml b/lamp/tasks/clean_dbuser.yml
deleted file mode 100644
index 8d7d0cd..0000000
--- a/lamp/tasks/clean_dbuser.yml
+++ /dev/null
@@ -1,13 +0,0 @@
----
-- name: supprimer la base de données {{ db_user }}
- community.mysql.mysql_db:
- name: '{{ db_user }}'
- state: absent
- login_unix_socket: '{{mariadb.socket}}'
-
-- name: supprimer l'utilisateur {{ db_user }}
- community.mysql.mysql_user:
- name: '{{ db_user }}'
- state: absent
- login_unix_socket: '{{mariadb.socket}}'
-
diff --git a/lamp/tasks/main.yml b/lamp/tasks/main.yml
deleted file mode 100644
index 0445a69..0000000
--- a/lamp/tasks/main.yml
+++ /dev/null
@@ -1,57 +0,0 @@
----
-# tasks file for lamp
-- include_vars: '{{ansible_os_family}}.yml'
- tags:
- - test
- - clean
-
-- name: installation de lamp
- package:
- update_cache: true
- name: "{{ lamp_packages }}"
- state: present
-
-- name: activation des services sur Redhat
- service:
- state: started
- name: '{{item}}'
- with_items:
- - httpd
- - mariadb
- when: ansible_os_family == 'RedHat'
-
-- name : activation du mod_rewrite d'apache sur Debian
- community.general.apache2_module:
- state: present
- name: rewrite
- when: ansible_os_family == 'Debian'
- notify:
- - restarting_apache
-
-- name: mise en place de index.html
- template:
- src: templates/index.j2
- dest: /var/www/html/index.html
- owner: "{{apache.user}}"
- group: "{{apache.user}}"
- mode: 0644
-
-- name: installation de phpmyadmin
- include_tasks:
- file: '{{ansible_os_family}}-phpmyadmin.yml'
- apply:
- tags: phpmyadmin
- tags: phpmyadmin
-
-- name: test dbuser
- import_tasks: test_dbuser.yml
- tags:
- - never
- - test
-
-- name: clean dbuser
- import_tasks: clean_dbuser.yml
- tags:
- - never
- - clean
-
diff --git a/lamp/tasks/test_dbuser.yml b/lamp/tasks/test_dbuser.yml
deleted file mode 100644
index c2243f3..0000000
--- a/lamp/tasks/test_dbuser.yml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-- name: install dépendances python
- package:
- name: '{{ mariadb.pythonlib }}'
- state: present
-
-- name: Créer la base de données {{ db_user }}
- community.mysql.mysql_db:
- name: '{{ db_user }}'
- state: present
- login_unix_socket: '{{mariadb.socket}}'
-
-- name: Créer un utilisateur {{ db_user }}
- community.mysql.mysql_user:
- name: '{{ db_user }}'
- password: '{{ db_passwd }}'
- priv: '{{ db_user }}.*:ALL'
- state: present
- login_unix_socket: '{{mariadb.socket}}'
diff --git a/lamp/templates/index.j2 b/lamp/templates/index.j2
deleted file mode 100644
index 29619c2..0000000
--- a/lamp/templates/index.j2
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>{{ansible_distribution}} Apache Web Server</title>
-<meta charset="utf-8" />
-</head>
-<body>
-<h1>{{ansible_distribution}} Apache Web Server</h1>
-<h2>Site en Constuction</h2>
-{% if lamp_packages is defined %}
-<h3>Packages :</h3>
-<ul>
-{% for item in lamp_packages %}
-<li>{{item}}</li>
-{% endfor %}
-</ul>
-{% endif %}
-<p>Généré par {{ ansible_distribution }} {{ ansible_distribution_version }}</p>
-</body>
-</html>
diff --git a/lamp/tests/inventory b/lamp/tests/inventory
deleted file mode 100644
index 878877b..0000000
--- a/lamp/tests/inventory
+++ /dev/null
@@ -1,2 +0,0 @@
-localhost
-
diff --git a/lamp/tests/test.yml b/lamp/tests/test.yml
deleted file mode 100644
index 10107f3..0000000
--- a/lamp/tests/test.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- hosts: localhost
- remote_user: root
- roles:
- - lamp \ No newline at end of file
diff --git a/lamp/vars/Debian.yml b/lamp/vars/Debian.yml
deleted file mode 100644
index 1c7659f..0000000
--- a/lamp/vars/Debian.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-lamp_packages:
- - apache2
- - mariadb-server
- - php
- - php-mysql
-
-apache:
- service: apache2
- user: www-data
-
-mariadb:
- socket: /var/run/mysqld/mysqld.sock
- pythonlib: python3-pymysql
-
diff --git a/lamp/vars/RedHat.yml b/lamp/vars/RedHat.yml
deleted file mode 100644
index b8033ee..0000000
--- a/lamp/vars/RedHat.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-lamp_packages:
- - httpd
- - mariadb-server
- - php
- - php-mysqlnd
-
-apache:
- service: httpd
- user: apache
-
-mariadb:
- socket: /var/lib/mysql/mysql.sock
- pythonlib: python3-PyMySQL
-
diff --git a/lamp/vars/main.yml b/lamp/vars/main.yml
deleted file mode 100644
index 56675e7..0000000
--- a/lamp/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# vars file for lamp