|
4 | 4 |
|
5 | 5 | #### Table of Contents
|
6 | 6 |
|
7 |
| -1. [Overview](#overview) |
| 7 | +1. [Important Notice About Version 3.0.0](#important-notice-about-version-300) |
| 8 | +2. [Overview](#overview) |
8 | 9 | * [Warning](#warning)
|
9 |
| -2. [Prerequisites](#prerequisites) |
| 10 | +3. [Prerequisites](#prerequisites) |
10 | 11 | * [General](#general)
|
11 | 12 | * [Arch Linux](#arch-linux)
|
12 |
| -3. [Customization](#customization) |
| 13 | +4. [Customization](#customization) |
13 | 14 | * [Hiera Data](#hiera-data)
|
14 | 15 | * [Sensitive Information](#sensitive-information)
|
15 |
| -4. [Setup](#setup) |
16 |
| -5. [Usage](#usage) |
17 |
| -6. [Reference](#reference) |
| 16 | +5. [Setup](#setup) |
| 17 | +6. [Usage](#usage) |
| 18 | +7. [Reference](#reference) |
18 | 19 | * [site.pp manifests](#site.pp-manifest)
|
19 | 20 | * [Puppetfile](#puppetfile)
|
20 | 21 | * [workstation_bootstrap module](#workstation_bootstrap-module)
|
21 | 22 | * [Hiera](#hiera)
|
22 | 23 | * [Hiera Ordering](#hiera-ordering)
|
23 |
| -7. [Testing](#testing) |
| 24 | +8. [Testing](#testing) |
| 25 | + |
| 26 | +## Important Notice About Version 3.0.0 |
| 27 | + |
| 28 | +Versions 2.0.0 and earlier of this repository were a full [control repository](https://puppet.com/docs/pe/latest/code_management/control_repo.html) setup for environments and intended to be checked out into the distribution default Puppet config directories (i.e. ``/etc/puppet/code``). I've found this to be cumbersome, unusual, and difficult to maintain. As a result, Version 3.0.0 changes this repository to run directly from the git clone in the way that masterless Puppet provisioners are typically used. Hopefully this will make it easier for others to use as an example. |
24 | 29 |
|
25 | 30 | ## Overview
|
26 | 31 |
|
27 |
| -This is an example of a puppet/[r10k](https://github.com/puppetlabs/r10k) [control repository](https://puppet.com/docs/pe/latest/code_management/control_repo.html) for use with my [archlinux_workstation](https://forge.puppet.com/jantman/archlinux_workstation) and optionally [archlinux_macbookretina](https://forge.puppet.com/jantman/archlinux_macbookretina) Puppet modules. This specific repository includes some personal configuration of mine, and is intended to be forked and modified as described below. This is intended to be a generic framework for anyone who wants to use Puppet to manage their workstation's configuration. The project provides some sane (though opinionated) defaults, and instructions for how to change them. The defaults are geared towards Arch Linux, but the core in this repository can be used for any distribution, or just as an example/starting point. |
| 32 | +This is an example of a puppet / [r10k](https://github.com/puppetlabs/r10k) masterless repository for use with my [archlinux_workstation](https://forge.puppet.com/jantman/archlinux_workstation) and optionally [archlinux_macbookretina](https://forge.puppet.com/jantman/archlinux_macbookretina) Puppet modules. This specific repository includes some personal configuration of mine, and is intended to be forked and modified as described below. This is intended to be a generic framework for anyone who wants to use Puppet to manage their workstation's configuration. The project provides some sane (though opinionated) defaults, and instructions for how to change them. The defaults are geared towards Arch Linux, but the core in this repository can be used for any distribution, or just as an example/starting point. |
28 | 33 |
|
29 | 34 | In general, what this repository has is:
|
30 | 35 |
|
31 | 36 | * a [Puppetfile](#puppetfile) for use with r10k, to install all dependencies.
|
32 | 37 | * a [site.pp main manifest](#site.pp-manifest), which sets up the top-scope things needed for [puppetlabs-firewall](https://forge.puppetlabs.com/puppetlabs/firewall)) and uses your [hiera data](#hiera) to include the classes you want to use.
|
33 |
| -* Some helper scripts under ``bin/`` to aid in installation and use. See [Setup](#setup) and [Usage](#usage). |
| 38 | +* Some helper scripts under ``bin/`` to aid in use. See [Setup](#setup) and [Usage](#usage). |
34 | 39 | * Documentation on initial setup of an Arch computer to use with this repo.
|
35 | 40 |
|
36 | 41 | ### Warning
|
@@ -68,9 +73,9 @@ Distro-specific instructions follow.
|
68 | 73 | Here's how to make this project do what you want:
|
69 | 74 |
|
70 | 75 | 1. Fork this repository.
|
71 |
| -2. Edit ``puppet/Puppetfile`` to contain all of the modules that you need as well as their dependencies. Unlike ``puppet module install``, r10k does not have dependency resolution. |
72 |
| -3. Edit the files under ``puppet/hiera/`` to do what you need. See below for more information. |
73 |
| -4. Edit ``puppet/manifests/site.pp`` as needed, though the default should be acceptable for most people. |
| 76 | +2. Edit ``Puppetfile`` to contain all of the modules that you need as well as their dependencies. Unlike ``puppet module install``, r10k does not have dependency resolution. |
| 77 | +3. Edit the files under ``hiera/`` to do what you need. See below for more information. |
| 78 | +4. Edit ``manifests/site.pp`` as needed, though the default should be acceptable for most people. |
74 | 79 | 5. Edit the spec tests under ``spec/hosts`` to match your changes in the previous steps.
|
75 | 80 | 6. Commit and push your changes.
|
76 | 81 |
|
@@ -104,23 +109,22 @@ Most users will have some sensitive information that they want on their machine
|
104 | 109 |
|
105 | 110 | To set up the project on one of your own machines:
|
106 | 111 |
|
107 |
| -1. ``cd /etc/puppetlabs/code`` |
108 |
| -2. ``git clone https://github.com/jantman/workstation-bootstrap.git workstation-bootstrap`` (or your fork, if you made one) |
109 |
| -3. ``cd workstation-bootstrap`` |
110 |
| -4. ``./bin/setup.sh`` |
111 |
| -5. Deploy the modules with r10k and then run Puppet: ``./bin/run_r10k_puppet.sh``. Assuming you're running under Arch Linux and using my [archlinux_workstation](https://github.com/jantman/puppet-archlinux-workstation) module, you'll want to do this either in a screen session or redirect the output to a file; at some point in the run, Xorg and SDDM will start up and your display will turn graphical. You can either login or use ``Ctrl + Alt + F2`` to get to a text console. If puppet dies when the ``sddm`` service starts, just re-run it. |
112 |
| -6. After the initial run, set the password for your newly-created user and then reboot. |
113 |
| -7. Log in as your user. |
| 112 | +1. ``git clone https://github.com/jantman/workstation-bootstrap.git`` (or your fork, if you made one) somewhere convenient; I use ``/root`` for ease. |
| 113 | +2. ``cd workstation-bootstrap`` |
| 114 | +3. To deploy the dependencies with r10k and then run Puppet: ``./bin/run_r10k_puppet.sh``. Assuming you're running under Arch Linux and using my [archlinux_workstation](https://github.com/jantman/puppet-archlinux-workstation) module, you'll want to do this either in a screen session or redirect the output to a file; at some point in the run, Xorg and SDDM will start up and your display will turn graphical. You can either login or use ``Ctrl + Alt + F2`` to get to a text console. If puppet dies when the ``sddm`` service starts, just re-run it. |
| 115 | +4. After the initial run, set the password for your newly-created user and then reboot. |
| 116 | +5. Log in as your user. |
114 | 117 |
|
115 | 118 | ## Usage
|
116 | 119 |
|
117 | 120 | * To run the r10k deploy, ``./bin/run_r10k.sh``
|
118 | 121 | * To run puppet on ``site.pp``, ``./bin/run_puppet.sh``
|
119 | 122 | * To run r10k and then puppet, ``./bin/run_r10k_puppet.sh``
|
120 |
| -* To find the value of a given key in the current Hiera data, ``./bin/hiera_show_value.sh KEY_NAME`` |
121 | 123 |
|
122 | 124 | ``./bin/run_puppet.sh`` and ``./bin/run_r10k_puppet.sh`` will add any command-line arguments that you specify to the ``puppet`` command before the path to ``site.pp`` (i.e. ``./bin/run_r10k_puppet.sh --noop`` will end run ``puppet`` with ``--noop``).
|
123 | 125 |
|
| 126 | +I generally create symlinks in ``~/bin`` to these scripts for ease. |
| 127 | + |
124 | 128 | ## Firewall Rules and Docker
|
125 | 129 |
|
126 | 130 | The pre-1.0.0 behavior of this module was to include a global firewall resource purge, to remove all unmanaged iptables rules:
|
@@ -160,27 +164,18 @@ At this moment, what this code does is:
|
160 | 164 |
|
161 | 165 | ### workstation_bootstrap module
|
162 | 166 |
|
163 |
| -This module has two classes, ``workstation_bootstrap::firewall_pre`` and ``workstation_bootstrap::firewall_post``, which |
| 167 | +The base ``workstation_bootstrap`` module can be found in ``modules/local/workstation_bootstrap``. It has two classes, ``workstation_bootstrap::firewall_pre`` and ``workstation_bootstrap::firewall_post``, which |
164 | 168 | do setup of default Firewall module rules, including accepting SSH on port 22.
|
165 | 169 |
|
166 | 170 | ### Puppetfile
|
167 | 171 |
|
168 |
| -* [archlinux_workstation](https://forge.puppet.com/jantman/archlinux_workstation) |
169 |
| -* [archlinux_macbookretina](https://forge.puppet.com/jantman/archlinux_macbookretina) |
170 |
| -* [puppetlabs/stdlib](https://forge.puppetlabs.com/puppetlabs/stdlib) |
171 |
| -* [saz/sudo](https://forge.puppetlabs.com/saz/sudo) (dependency of archlinux_workstation) |
172 |
| -* [saz/ssh](https://forge.puppetlabs.com/saz/ssh) (dependency of archlinux_workstation) |
173 |
| -* [puppetlabs/firewall](https://forge.puppetlabs.com/puppetlabs/firewall) |
174 |
| -* [puppetlabs/inifile](https://forge.puppetlabs.com/puppetlabs/inifile) |
175 |
| -* [puppetlabs/vcsrepo](https://forge.puppetlabs.com/puppetlabs/vcsrepo) |
176 |
| -* [eirc/single_user_rvm](https://forge.puppetlabs.com/eirc/single_user_rvm) |
177 |
| -* [nanliu/staging](https://forge.puppetlabs.com/nanliu/staging) |
| 172 | +See [Puppetfile](Puppetfile) itself for the current list of included dependencies. |
178 | 173 |
|
179 | 174 | By default, the Puppetfile also includes my personal "privatepuppet" module. You should comment this out or replace it with your own personal module(s).
|
180 | 175 |
|
181 | 176 | ### Hiera
|
182 | 177 |
|
183 |
| -The Hiera hierarchy used is as follows: |
| 178 | +The Hiera hierarchy used is rooted at ``hiera/`` and has configurations as follows: |
184 | 179 |
|
185 | 180 | * ``defaults.yaml`` - default configuration and classes
|
186 | 181 | * ``osfamily/Archlinux.yaml`` - include ``archlinux-workstation`` class on Arch Linux
|
|
0 commit comments