Merge "[fuel] Add IDF mappings to installer adapter"
[pharos.git] / config / utils / README.eyaml.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. (c) 2017 OPNFV and others.
4
5 Use eyaml to decrypt secret values
6 ==================================
7
8 Prerequisites
9 -------------
10
11 #. Install eyaml and create keys (All of this should be done on the slave server)
12
13     .. code-block:: bash
14
15         $ sudo yum install ruby-gems || sudo apt-get install ruby
16         $ sudo gem install hiera-eyaml
17         $ eyaml createkeys
18
19 #. Move keys to /etc/eyaml_keys
20
21     .. code-block:: bash
22
23         $ sudo mkdir -p /etc/eyaml_keys/
24         $ sudo mv ./keys/* /etc/eyaml_keys/
25
26 #. Set up eyaml config.yaml
27
28     .. code-block:: bash
29
30         $ mkdir ~/.eyaml/
31         $ cp config.yaml.example ~/.eyaml/config.yaml
32
33 Encryption
34 ----------
35
36 #. Copy a PDF (yaml) to current directory (or edit the PDF in-place)
37
38 NOTE: There is a sample encrypted PDF located at `../pdf/pod1.encrypted.yaml`.
39 Data in that file is only an example and can't be decrypted without the PEM,
40 which is not provided.
41
42     .. code-block:: bash
43
44         $ cp ~/foo/securedlab/labs/lf/pod2.yaml .
45
46 #. Create some encrypted values
47
48     .. code-block:: bash
49
50         $ eyaml encrypt -s 'opnfv'
51
52 #. Replace values to be encrypted
53
54     .. code-block:: yaml
55
56         type: ipmi
57         versions:
58           - 2.0
59         user: ENC[PKCS7 ...]
60         pass: ENC[PKCS7 ...]
61
62 Decryption
63 ----------
64
65     .. code-block:: bash
66
67         $ ./generate_config.py -y pod2.yaml -j ../installers/apex/pod_config.yaml.j2