• R/O
  • HTTP
  • SSH
  • HTTPS

phpplaybook: Commit


Commit MetaInfo

Revision6b14a64a279b4de7f1839058318a301bf7954739 (tree)
Zeit2021-11-06 22:37:13
AutorYoshihiro Saitoh <shupeluter@hotm...>
CommiterYoshihiro Saitoh

Log Message

PHP環境を作ってみた

Ändern Zusammenfassung

Diff

--- a/inventory/hosts
+++ b/inventory/hosts
@@ -1,2 +1 @@
1-#[HOGEGROUPO]
2-#xxx.xxx.xxx.xxx
\ No newline at end of file
1+#This Playboot create for localhost, thus there are no need to setting host.
\ No newline at end of file
--- a/main.yml
+++ b/main.yml
@@ -1,5 +1,5 @@
1-- hosts: [hostname]
2- user: [execute user]
1+- hosts: localhost
32 become: true
3+ gather_facts: false
44 roles:
5- - [roles]
\ No newline at end of file
5+ - 00.install
\ No newline at end of file
--- /dev/null
+++ b/roles/00.install/files/sample.php
@@ -0,0 +1,3 @@
1+<?php
2+ phpinfo();
3+?>
\ No newline at end of file
--- /dev/null
+++ b/roles/00.install/handlers/main.yml
@@ -0,0 +1,5 @@
1+- name: restart apache2
2+ service:
3+ name: apache2
4+ state: restarted
5+ enabled: yes
\ No newline at end of file
--- /dev/null
+++ b/roles/00.install/tasks/main.yml
@@ -0,0 +1,14 @@
1+- name: install pkgs
2+ apt:
3+ name: "{{install_pkgs}}"
4+ state: present
5+ update_cache: true
6+ notify:
7+ - restart apache2
8+
9+- name: deliver sample file
10+ copy:
11+ src: sample.php
12+ dest: /var/www/html/info.php
13+ notify:
14+ - restart apache2
\ No newline at end of file
--- /dev/null
+++ b/roles/00.install/vars/main.yml
@@ -0,0 +1,4 @@
1+install_pkgs:
2+ - php
3+ - libapache2-mod-php
4+ - apache2
\ No newline at end of file
--- a/roles/common/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
1-Role Name
2-=========
3-
4-A brief description of the role goes here.
5-
6-Requirements
7-------------
8-
9-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.
10-
11-Role Variables
12---------------
13-
14-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.
15-
16-Dependencies
17-------------
18-
19-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.
20-
21-Example Playbook
22-----------------
23-
24-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
25-
26- - hosts: servers
27- roles:
28- - { role: username.rolename, x: 42 }
29-
30-License
31--------
32-
33-BSD
34-
35-Author Information
36-------------------
37-
38-An optional section for the role authors to include contact information, or a website (HTML is not allowed).
--- a/roles/common/defaults/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
1----
2-# defaults file for roles/common
\ No newline at end of file
--- a/roles/common/handlers/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
1----
2-# handlers file for roles/common
\ No newline at end of file
--- a/roles/common/meta/main.yml
+++ /dev/null
@@ -1,57 +0,0 @@
1-galaxy_info:
2- author: your name
3- description: your description
4- company: your company (optional)
5-
6- # If the issue tracker for your role is not on github, uncomment the
7- # next line and provide a value
8- # issue_tracker_url: http://example.com/issue/tracker
9-
10- # Some suggested licenses:
11- # - BSD (default)
12- # - MIT
13- # - GPLv2
14- # - GPLv3
15- # - Apache
16- # - CC-BY
17- license: license (GPLv2, CC-BY, etc)
18-
19- min_ansible_version: 1.2
20-
21- # If this a Container Enabled role, provide the minimum Ansible Container version.
22- # min_ansible_container_version:
23-
24- # Optionally specify the branch Galaxy will use when accessing the GitHub
25- # repo for this role. During role install, if no tags are available,
26- # Galaxy will use this branch. During import Galaxy will access files on
27- # this branch. If Travis integration is configured, only notifications for this
28- # branch will be accepted. Otherwise, in all cases, the repo's default branch
29- # (usually master) will be used.
30- #github_branch:
31-
32- #
33- # platforms is a list of platforms, and each platform has a name and a list of versions.
34- #
35- # platforms:
36- # - name: Fedora
37- # versions:
38- # - all
39- # - 25
40- # - name: SomePlatform
41- # versions:
42- # - all
43- # - 1.0
44- # - 7
45- # - 99.99
46-
47- galaxy_tags: []
48- # List tags for your role here, one per line. A tag is a keyword that describes
49- # and categorizes the role. Users find roles by searching for tags. Be sure to
50- # remove the '[]' above, if you add tags to this list.
51- #
52- # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
53- # Maximum 20 tags per role.
54-
55-dependencies: []
56- # List your role dependencies here, one per line. Be sure to remove the '[]' above,
57- # if you add dependencies to this list.
\ No newline at end of file
--- a/roles/common/tasks/createUsers.yml
+++ /dev/null
@@ -1,5 +0,0 @@
1-- name: create users
2- user:
3- name: "{{item.username}}"
4- password: "{{item.password}}"
5- with_items: "{{users}}"
\ No newline at end of file
--- a/roles/common/tasks/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
1----
2-# tasks file for roles/common
3-- name: 01.createUsers
4- include: createUsers.yml
\ No newline at end of file
--- a/roles/common/tests/test.yml
+++ /dev/null
@@ -1,5 +0,0 @@
1----
2-- hosts: localhost
3- remote_user: root
4- roles:
5- - roles/common
\ No newline at end of file
--- a/roles/common/vars/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
1----
2-# vars file for roles/common
3-users:
4- - {username: piwork,password: "{{'piwork'|password_hash('sha512')}}"}
5-
\ No newline at end of file
Show on old repository browser