|
1 | 1 | # Holds private information for the ce-deploy setup
|
| 2 | +This is a template repository intended as a starting point for new ce-deploy installations. It contains sane defaults and example configurations for more complex infrastructures and all the configuration required for Ansible to work out of the box. |
2 | 3 |
|
3 |
| -## hosts |
4 |
| -This will be symlinked to /etc/ansible/hosts |
| 4 | +[Find out more about ce-deploy here.](https://github.com/codeenigma/ce-deploy/wiki) |
5 | 5 |
|
6 |
| -## fact.d |
7 |
| -This will be symlinked to /etc/ansible/fact.d |
| 6 | +# Using AWS EC2 inventory discovery |
| 7 | +If you intend to use AWS as one of your hosting providers and you want to enable AWS inventory support, first in `ansible.cfg`. The default config file looks like this: |
8 | 8 |
|
9 |
| -## group_vars |
10 |
| -This will be symlinked to /etc/ansible/group_vars |
| 9 | +```conf |
| 10 | +[inventory] |
| 11 | +# enable inventory plugins, default: 'host_list', 'script', 'yaml', 'ini', 'auto' |
| 12 | +enable_plugins = yaml, ini |
| 13 | +# uncomment the below line and comment the above for AWS EC2 inventory discovery |
| 14 | +#enable_plugins = amazon.aws.aws_ec2, yaml, ini |
| 15 | +``` |
11 | 16 |
|
| 17 | +Change it to look like this: |
| 18 | + |
| 19 | +```conf |
| 20 | +[inventory] |
| 21 | +# enable inventory plugins, default: 'host_list', 'script', 'yaml', 'ini', 'auto' |
| 22 | +enable_plugins = amazon.aws.aws_ec2, yaml, ini |
| 23 | +``` |
| 24 | + |
| 25 | +Then edit `hosts/aws_ec2.yml` and set it up how you wish. |
| 26 | + |
| 27 | +# Using SOPS for variable encryption |
| 28 | +SOPS is loaded in by default, however to use it you will need to add the PGP key fingerprint of any team member who needs to be able to encrypt and decrypt SOPS variables to `.sops.yml` in this repository. |
| 29 | + |
| 30 | +[The SOPS documentation is here.](https://github.com/getsops/sops/blob/main/README.rst) |
| 31 | + |
| 32 | +# Files and directories |
| 33 | +Although ce-deploy is fairly flexible, this is a list of supplied files and directories and what they are generally used for. It provides a model for potentially organising your Ansible configuration. If you install ce-deploy with ce-provision these files and directories will be handled as follows: |
| 34 | + |
| 35 | +## Directories |
| 36 | +These are the provided directories which are not linked into ce-deploy. |
| 37 | + |
| 38 | +### plays |
| 39 | +This is a space where you can optionally keep playbooks that are unique to your organisation. |
| 40 | + |
| 41 | +### roles |
| 42 | +This is where we recommend you keep any roles that are unique to your organisation, for example they might contain configurations you do not wish to share or they might be simply of no use to the wider product. For example, we keep roles for managing our LDAP directory server in this directory. It is automatically included in Ansible's roles path in the provided `ansible.cfg`. |
| 43 | + |
| 44 | +## Linked files |
| 45 | +These files are obligatory in the config repository and are linked into ce-deploy in the required places to make Ansible function as expected. |
| 46 | + |
| 47 | +### hosts |
| 48 | +This will be symlinked to the `hosts` directory in the root of your Ansible installation. |
| 49 | + |
| 50 | +### ansible.cfg |
| 51 | +This will be symlinked into the root of your Ansible installation. |
| 52 | + |
| 53 | +More information: |
| 54 | +* https://codeenigma.github.io/ce-provision-docs/2.x/roles/debian/ce_deploy/ |
| 55 | +* https://github.com/codeenigma/ce-provision/blob/2.x/roles/debian/ce_deploy/tasks/main.yml#L56-L91 |
| 56 | + |
| 57 | +# Beware the `deploy` user |
| 58 | +We assume your `ce-deploy` user `deploy` - if that is not the case you will need to replace `deploy` with the replacement value for usernames in `ansible.cfg`. |
| 59 | + |
| 60 | +# Seeding `ce-deploy` config |
| 61 | +This repo is a template for seeding a new configuration repo for `ce-deploy` which will get pulled on to the deploy server when the `ce_deploy` role is used in `ce-provision`. Copy this over the repo you created above then find and replace these strings before committing: |
| 62 | + |
| 63 | +* `SHORTNAME` - should be your client shortname, e.g. `acme` |
| 64 | + |
| 65 | +Tip - this terminal command will make your life easier: `find ./ -type f -exec sed -i -e 's/SHORTNAME/acme/g' {} \;` |
| 66 | + |
| 67 | +# SOPS |
| 68 | +There is an example `.sops.yaml` file included in case you need SOPS. Many projects will not, but if you need to include encrypted secrets, such as API keys or credentials to other third party systems that web applications need to have in order to be deployed, you will need to configure this. It can certainly be ignored for a first pass set-up. |
0 commit comments