Changeset - 80c77d68b540
[Not reviewed]
0 1 0
Branko Majic (branko) - 8 years ago 2015-10-25 18:29:08
branko@majic.rs
MAR-18: Added usage instructions for the database server role.
1 file changed with 47 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/usage.rst
Show inline comments
 
@@ -1045,3 +1045,50 @@ Nginx on the server.
 
   page available and visible at `https://www.example.com/`. Feel free to try it
 
   out with some browser. Keep in mind you will get a warning about the
 
   untrusted certificate!
 

	
 

	
 
Adding the database server
 
--------------------------
 

	
 
Since both of the web applications we want to deploy need a database, we will
 
proceed to set-up the database server role on the web server itself. *Majic
 
Ansible Roles* in particular comes with a role that will deploy MariaDB database
 
server.
 

	
 
1. Update the playbook for web server to include the database server role.
 

	
 

	
 
    :file:`~/mysite/playbooks/web.yml`::
 

	
 
      ---
 
      - hosts: web
 
        remote_user: ansible
 
        sudo: yes
 
        roles:
 
          - common
 
          - ldap_client
 
          - mail_forwarder
 
          - web_server
 
          - database_server
 

	
 
2. Now let's configure the role. This is rather simplistic, since we only need
 
   to set the database server root (admin) password.
 

	
 
   :file:`~/mysite/group_vars/web.yml`::
 

	
 
      db_root_password: root
 

	
 
3. No TLS support has been implemented for this role (yet), so simply apply the
 
   changes::
 

	
 
     ansible-playbook playbooks/site.yml
 

	
 
4. If no errors have been reported, you should have a database server up and
 
   running on the web server. You should be able to log-in using password
 
   ``root`` via command::
 

	
 
     mysql -uroot -p
 

	
 
   Of course, no database has been created for either of the web applications,
 
   but we will get to that one later (there is a dedicated ``database`` role
 
   which can be combined with web app roles for this purpose).
0 comments (0 inline, 0 general)