Show More
@@ -1,175 +1,175 b'' | |||||
1 | .. _installation_puppet: |
|
1 | .. _installation_puppet: | |
2 |
|
2 | |||
3 | =================================== |
|
3 | =================================== | |
4 | Installation and setup using Puppet |
|
4 | Installation and setup using Puppet | |
5 | =================================== |
|
5 | =================================== | |
6 |
|
6 | |||
7 | The whole installation and setup process of Kallithea can be simplified by |
|
7 | The whole installation and setup process of Kallithea can be simplified by | |
8 | using Puppet and the `rauch/kallithea |
|
8 | using Puppet and the `rauch/kallithea | |
9 | <https://forge.puppetlabs.com/rauch/kallithea>`_ Puppet module. This is |
|
9 | <https://forge.puppetlabs.com/rauch/kallithea>`_ Puppet module. This is | |
10 | especially useful for getting started quickly, without having to deal with all |
|
10 | especially useful for getting started quickly, without having to deal with all | |
11 | the Python specialities. |
|
11 | the Python specialities. | |
12 |
|
12 | |||
13 | .. note:: The following instructions assume you are not familiar with Puppet at |
|
13 | .. note:: The following instructions assume you are not familiar with Puppet at | |
14 | all. If this is not the case, you should probably skip directly to the |
|
14 | all. If this is not the case, you should probably skip directly to the | |
15 | `Kallithea Puppet module documentation |
|
15 | `Kallithea Puppet module documentation | |
16 | <https://forge.puppetlabs.com/rauch/kallithea#puppet-kallithea>`_. |
|
16 | <https://forge.puppetlabs.com/rauch/kallithea#puppet-kallithea>`_. | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | Installing Puppet |
|
19 | Installing Puppet | |
20 | ----------------- |
|
20 | ----------------- | |
21 |
|
21 | |||
22 | This installation variant requires a Unix/Linux type server with Puppet 3.0+ |
|
22 | This installation variant requires a Unix/Linux type server with Puppet 3.0+ | |
23 | installed. Many major distributions have Puppet in their standard repositories. |
|
23 | installed. Many major distributions have Puppet in their standard repositories. | |
24 | Thus, you will probably be ready to go by running, e.g. ``apt-get install |
|
24 | Thus, you will probably be ready to go by running, e.g. ``apt-get install | |
25 | puppet`` or ``yum install puppet``, depending on your distro's favoured package |
|
25 | puppet`` or ``yum install puppet``, depending on your distro's favoured package | |
26 | manager. Afterwards, check the Puppet version by running ``puppet --version`` |
|
26 | manager. Afterwards, check the Puppet version by running ``puppet --version`` | |
27 | and ensure you have at least 3.0. |
|
27 | and ensure you have at least 3.0. | |
28 |
|
28 | |||
29 | If your distribution does not provide Puppet packages or you need a |
|
29 | If your distribution does not provide Puppet packages or you need a | |
30 | newer version, please see the `Puppet Reference Manual |
|
30 | newer version, please see the `Puppet Reference Manual | |
31 | <https://docs.puppetlabs.com/puppet/4.2/reference/install_linux.html>`_ for |
|
31 | <https://docs.puppetlabs.com/puppet/4.2/reference/install_linux.html>`_ for | |
32 | instructions on how to install Puppet on your target platform. |
|
32 | instructions on how to install Puppet on your target platform. | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | Installing the Puppet module |
|
35 | Installing the Puppet module | |
36 | ---------------------------- |
|
36 | ---------------------------- | |
37 |
|
37 | |||
38 | To install the latest version of the Kallithea Puppet module from the Puppet |
|
38 | To install the latest version of the Kallithea Puppet module from the Puppet | |
39 | Forge, run the following as ``root``: |
|
39 | Forge, run the following as ``root``: | |
40 |
|
40 | |||
41 | .. code-block:: bash |
|
41 | .. code-block:: bash | |
42 |
|
42 | |||
43 | puppet module install rauch/kallithea |
|
43 | puppet module install rauch/kallithea | |
44 |
|
44 | |||
45 | This will install both the Kallithea Puppet module and its dependency modules. |
|
45 | This will install both the Kallithea Puppet module and its dependency modules. | |
46 |
|
46 | |||
47 | .. warning:: Be aware that Puppet can do all kinds of things to your systems. |
|
47 | .. warning:: Be aware that Puppet can do all kinds of things to your systems. | |
48 | Third-party modules (like the ``kallithea`` module) may run |
|
48 | Third-party modules (like the ``kallithea`` module) may run | |
49 | arbitrary commands on your system (most of the time as the |
|
49 | arbitrary commands on your system (most of the time as the | |
50 | ``root`` user), so do not apply them on production machines if |
|
50 | ``root`` user), so do not apply them on production machines if | |
51 | you don't know what you are doing. Instead, use a test system |
|
51 | you don't know what you are doing. Instead, use a test system | |
52 | (e.g. a virtual machine) for evaluation purposes. |
|
52 | (e.g. a virtual machine) for evaluation purposes. | |
53 |
|
53 | |||
54 |
|
54 | |||
55 | Applying the module |
|
55 | Applying the module | |
56 | ------------------- |
|
56 | ------------------- | |
57 |
|
57 | |||
58 | To trigger the actual installation process, we have to *apply* the |
|
58 | To trigger the actual installation process, we have to *apply* the | |
59 | ``kallithea`` Puppet class, which is provided by the module we have just |
|
59 | ``kallithea`` Puppet class, which is provided by the module we have just | |
60 | installed, to our system. For this, create a file named e.g. ``kallithea.pp``, |
|
60 | installed, to our system. For this, create a file named e.g. ``kallithea.pp``, | |
61 | a *Puppet manifest*, with the following content: |
|
61 | a *Puppet manifest*, with the following content: | |
62 |
|
62 | |||
63 | .. _simple_manifest: |
|
63 | .. _simple_manifest: | |
64 | .. code-block:: puppet |
|
64 | .. code-block:: puppet | |
65 |
|
65 | |||
66 | class { 'kallithea': |
|
66 | class { 'kallithea': | |
67 | seed_db => true, |
|
67 | seed_db => true, | |
68 | manage_git => true, |
|
68 | manage_git => true, | |
69 | } |
|
69 | } | |
70 |
|
70 | |||
71 | To apply the manifest, simply run the following (preferably as root): |
|
71 | To apply the manifest, simply run the following (preferably as root): | |
72 |
|
72 | |||
73 | .. code-block:: bash |
|
73 | .. code-block:: bash | |
74 |
|
74 | |||
75 | puppet apply kallithea.pp |
|
75 | puppet apply kallithea.pp | |
76 |
|
76 | |||
77 | This will basically run through the usual Kallithea :ref:`installation` and |
|
77 | This will basically run through the usual Kallithea :ref:`installation` and | |
78 | :ref:`setup` steps, as documented. Consult the module documentation for details |
|
78 | :ref:`setup` steps, as documented. Consult the module documentation for details | |
79 | on `what the module affects |
|
79 | on `what the module affects | |
80 | <https://forge.puppetlabs.com/rauch/kallithea#what-kallithea-affects>`_. You |
|
80 | <https://forge.puppetlabs.com/rauch/kallithea#what-kallithea-affects>`_. You | |
81 | can also do a *dry run* by adding the ``--noop`` option to the command. |
|
81 | can also do a *dry run* by adding the ``--noop`` option to the command. | |
82 |
|
82 | |||
83 |
|
83 | |||
84 | Using parameters for customizing the setup process |
|
84 | Using parameters for customizing the setup process | |
85 | -------------------------------------------------- |
|
85 | -------------------------------------------------- | |
86 |
|
86 | |||
87 | The ``kallithea`` Puppet class provides a number of `parameters |
|
87 | The ``kallithea`` Puppet class provides a number of `parameters | |
88 | <https://forge.puppetlabs.com/rauch/kallithea#class-kallithea>`_ for |
|
88 | <https://forge.puppetlabs.com/rauch/kallithea#class-kallithea>`_ for | |
89 | customizing the setup process. You have seen the usage of the ``seed_db`` |
|
89 | customizing the setup process. You have seen the usage of the ``seed_db`` | |
90 | parameter in the :ref:`example above <simple_manifest>`, but there are more. |
|
90 | parameter in the :ref:`example above <simple_manifest>`, but there are more. | |
91 | For example, you can specify the installation directory, the name of the user |
|
91 | For example, you can specify the installation directory, the name of the user | |
92 | under which Kallithea gets installed, the initial admin password, etc. |
|
92 | under which Kallithea gets installed, the initial admin password, etc. | |
93 | Notably, you can provide arbitrary modifications to Kallitheas configuration |
|
93 | Notably, you can provide arbitrary modifications to Kallithea's configuration | |
94 | file by means of the ``config_hash`` parameter. |
|
94 | file by means of the ``config_hash`` parameter. | |
95 |
|
95 | |||
96 | Parameters, which have not been set explicitly, will be set to default values, |
|
96 | Parameters, which have not been set explicitly, will be set to default values, | |
97 | which are defined inside the ``kallithea`` Puppet module. For example, if you |
|
97 | which are defined inside the ``kallithea`` Puppet module. For example, if you | |
98 | just stick to the defaults as in the :ref:`example above <simple_manifest>`, |
|
98 | just stick to the defaults as in the :ref:`example above <simple_manifest>`, | |
99 | you will end up with a Kallithea instance, which |
|
99 | you will end up with a Kallithea instance, which | |
100 |
|
100 | |||
101 | - is installed in ``/srv/kallithea``, owned by the user ``kallithea`` |
|
101 | - is installed in ``/srv/kallithea``, owned by the user ``kallithea`` | |
102 | - uses the Kallithea default configuration |
|
102 | - uses the Kallithea default configuration | |
103 | - uses the admin user ``admin`` with password ``adminpw`` |
|
103 | - uses the admin user ``admin`` with password ``adminpw`` | |
104 | - is started automatically and enabled on boot |
|
104 | - is started automatically and enabled on boot | |
105 |
|
105 | |||
106 | As of Kallithea 0.3.0, this in particular means that Kallithea will use an |
|
106 | As of Kallithea 0.3.0, this in particular means that Kallithea will use an | |
107 | SQLite database and listen on ``http://localhost:5000``. |
|
107 | SQLite database and listen on ``http://localhost:5000``. | |
108 |
|
108 | |||
109 | See also the `full parameters list |
|
109 | See also the `full parameters list | |
110 | <https://forge.puppetlabs.com/rauch/kallithea#class-kallithea>`_ for more |
|
110 | <https://forge.puppetlabs.com/rauch/kallithea#class-kallithea>`_ for more | |
111 | information. |
|
111 | information. | |
112 |
|
112 | |||
113 |
|
113 | |||
114 | Making your Kallithea instance publicly available |
|
114 | Making your Kallithea instance publicly available | |
115 | ------------------------------------------------- |
|
115 | ------------------------------------------------- | |
116 |
|
116 | |||
117 | If you followed the instructions above, the Kallithea instance will be |
|
117 | If you followed the instructions above, the Kallithea instance will be | |
118 | listening on ``http://localhost:5000`` and therefore not publicly available. |
|
118 | listening on ``http://localhost:5000`` and therefore not publicly available. | |
119 | There are several ways to change this. |
|
119 | There are several ways to change this. | |
120 |
|
120 | |||
121 | The direct way |
|
121 | The direct way | |
122 | ^^^^^^^^^^^^^^ |
|
122 | ^^^^^^^^^^^^^^ | |
123 |
|
123 | |||
124 | The simplest setup is to instruct Kallithea to listen on another IP address |
|
124 | The simplest setup is to instruct Kallithea to listen on another IP address | |
125 | and/or port by using the ``config_hash`` parameter of the Kallithea Puppet |
|
125 | and/or port by using the ``config_hash`` parameter of the Kallithea Puppet | |
126 | class. For example, assume we want to listen on all interfaces on port 80: |
|
126 | class. For example, assume we want to listen on all interfaces on port 80: | |
127 |
|
127 | |||
128 | .. code-block:: puppet |
|
128 | .. code-block:: puppet | |
129 |
|
129 | |||
130 | class { 'kallithea': |
|
130 | class { 'kallithea': | |
131 | seed_db => true, |
|
131 | seed_db => true, | |
132 | config_hash => { |
|
132 | config_hash => { | |
133 | "server:main" => { |
|
133 | "server:main" => { | |
134 | 'host' => '0.0.0.0', |
|
134 | 'host' => '0.0.0.0', | |
135 | 'port' => '80', |
|
135 | 'port' => '80', | |
136 | } |
|
136 | } | |
137 | } |
|
137 | } | |
138 | } |
|
138 | } | |
139 |
|
139 | |||
140 | Using Apache as reverse proxy |
|
140 | Using Apache as reverse proxy | |
141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
142 |
|
142 | |||
143 | In a more advanced setup, you might instead want use a full-blown web server |
|
143 | In a more advanced setup, you might instead want use a full-blown web server | |
144 | like Apache HTTP Server as the public web server, configured such that requests |
|
144 | like Apache HTTP Server as the public web server, configured such that requests | |
145 | are internally forwarded to the local Kallithea instance (a so called *reverse |
|
145 | are internally forwarded to the local Kallithea instance (a so called *reverse | |
146 | proxy setup*). This can be easily done with Puppet as well: |
|
146 | proxy setup*). This can be easily done with Puppet as well: | |
147 |
|
147 | |||
148 | First, install the `puppetlabs/apache |
|
148 | First, install the `puppetlabs/apache | |
149 | <https://forge.puppetlabs.com/puppetlabs/apache>`_ Puppet module as above by running the following as root: |
|
149 | <https://forge.puppetlabs.com/puppetlabs/apache>`_ Puppet module as above by running the following as root: | |
150 |
|
150 | |||
151 | .. code-block:: bash |
|
151 | .. code-block:: bash | |
152 |
|
152 | |||
153 | puppet module install puppetlabs/apache |
|
153 | puppet module install puppetlabs/apache | |
154 |
|
154 | |||
155 | Then, append the following to your manifest: |
|
155 | Then, append the following to your manifest: | |
156 |
|
156 | |||
157 | .. code-block:: puppet |
|
157 | .. code-block:: puppet | |
158 |
|
158 | |||
159 | include apache |
|
159 | include apache | |
160 |
|
160 | |||
161 | apache::vhost { 'kallithea.example.com': |
|
161 | apache::vhost { 'kallithea.example.com': | |
162 | docroot => '/var/www/html', |
|
162 | docroot => '/var/www/html', | |
163 | manage_docroot => false, |
|
163 | manage_docroot => false, | |
164 | port => 80, |
|
164 | port => 80, | |
165 | proxy_preserve_host => true, |
|
165 | proxy_preserve_host => true, | |
166 | proxy_pass => [ |
|
166 | proxy_pass => [ | |
167 | { |
|
167 | { | |
168 | path => '/', |
|
168 | path => '/', | |
169 | url => 'http://localhost:5000/', |
|
169 | url => 'http://localhost:5000/', | |
170 | }, |
|
170 | }, | |
171 | ], |
|
171 | ], | |
172 | } |
|
172 | } | |
173 |
|
173 | |||
174 | Applying the resulting manifest will install the Apache web server and setup a |
|
174 | Applying the resulting manifest will install the Apache web server and setup a | |
175 | virtual host acting as a reverse proxy for your local Kallithea instance. |
|
175 | virtual host acting as a reverse proxy for your local Kallithea instance. |
General Comments 0
You need to be logged in to leave comments.
Login now