Changeset - f8c33675b503
[Not reviewed]
0 1 0
Branko Majic (branko) - 7 years ago 2017-08-22 00:44:41
branko@majic.rs
MAR-125: Updated usage instructions:

- Point to specific Debian release instructions for preseed file usage.
- Use python-pexpect for installing The Bug Genie.
- Added instructions for creating the handlers directory for wiki sample role.
1 file changed with 41 insertions and 11 deletions:
0 comments (0 inline, 0 general)
docs/usage.rst
Show inline comments
 
@@ -309,7 +309,7 @@ Installing the servers with preseed files
 
You have your preseed files now, so you can go ahead and install the servers
 
``comms.example.com``, ``www.example.com``, and ``bak.example.com`` using
 
them with network install CD. Have a look at `Debian
 
<https://www.debian.org/releases/stable/amd64/apbs02.html.en>`_ instructions for
 
<https://www.debian.org/releases/jessie/amd64/apbs02.html.en>`_ instructions for
 
more details.
 

	
 
If you need to, you can easily serve the preseed files from the Ansible server
 
@@ -1431,6 +1431,9 @@ Before we start, here is a couple of useful pointers regarding the
 
        copy: src="b2db.yml" dest="/var/www/tbg.example.com/thebuggenie-{{ tbg_version }}/core/config/b2db.yml"
 
              mode=640 owner=admin-tbg_example_com group=web-tbg_example_com
 

	
 
      - name: Install pexpect package
 
        apt: name=python-pexpect state=installed
 

	
 
      - name: Deploy expect script for installing TBG
 
        copy: src="tbg_expect_install" dest="/var/www/tbg.example.com/tbg_expect_install" mode=750
 
        become: yes
 
@@ -1438,8 +1441,8 @@ Before we start, here is a couple of useful pointers regarding the
 

	
 
      - name: Run TBG installer via expect script
 
        command: /var/www/tbg.example.com/tbg_expect_install
 
                 chdir=/var/www/tbg.example.com/thebuggenie-{{ tbg_version }} 
 
                 creates=/var/www/tbg.example.com/thebuggenie-{{ tbg_version }}/installed
 
                 chdir="/var/www/tbg.example.com/thebuggenie-{{ tbg_version }}"
 
                 creates="/var/www/tbg.example.com/thebuggenie-{{ tbg_version }}/installed"
 
        become: yes
 
        become_user: admin-tbg_example_com
 

	
 
@@ -1458,15 +1461,42 @@ Before we start, here is a couple of useful pointers regarding the
 
   :file:`~/mysite/roles/tbg/files/tbg_expect_install`
 
   ::
 

	
 
      #!/usr/bin/expect
 
      #!/usr/bin/env python
 

	
 
      import pexpect
 

	
 
      # Spawn the process.
 
      install_process = pexpect.spawnu('./tbg_cli', args = ["install",
 
                                                                        "--accept_license=yes",
 
                                                                        "--url_subdir=/",
 
                                                                        "--use_existing_db_info=yes",
 
                                                                        "--enable_all_modules=no",
 
                                                                        "--setup_htaccess=yes"])
 

	
 
      # If we get EOF, we probably already installed application, and ran
 
      # into error at the end since no patterns matched.
 
      try:
 
          # First confirmation.
 
          install_process.expect(u'Press ENTER to continue with the installation: ', timeout=5)
 
          install_process.sendline(u'')
 
          # Second confirmation.
 
          install_process.expect(u'Press ENTER to continue: ', timeout=5)
 
          install_process.sendline(u'')
 

	
 
          # Wait for application to finish.
 
          install_process.expect(pexpect.EOF)
 

	
 
      except pexpect.EOF as e:
 
          pass
 

	
 
      # Close application.
 
      install_process.close()
 

	
 
      spawn ./tbg_cli install --accept_license=yes --url_subdir=/ --use_existing_db_info=yes --enable_all_modules=yes --setup_htaccess=yes
 
      # Print text output.
 
      print(install_process.before)
 

	
 
      expect "Press ENTER to continue with the installation: "
 
      send "\r"
 
      expect "Press ENTER to continue: "
 
      send "\r"
 
      interact
 
      # Return same exit code like child process.
 
      exit(install_process.exitstatus)
 

	
 
6. And... Let's add the new role to our web server.
 

	
 
@@ -1563,7 +1593,7 @@ on the safe side:
 

	
 
1. Set-up the necessary directories first::
 

	
 
     mkdir -p ~/mysite/roles/wiki/{tasks,meta,files}/
 
     mkdir -p ~/mysite/roles/wiki/{tasks,meta,files,handlers}/
 

	
 
2. Set-up some role dependencies, reusing the common role infrastructure.
 

	
0 comments (0 inline, 0 general)