You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/infrasec/ansible/ansible-primer.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,14 @@ remote-execution tool originally designed to orchestrate a wider environment, it
5
5
with things like Packer, which is where you are most likely to see it in a Truss environment.
6
6
7
7
This primer is not intended to replace the official documentation for Ansible, which can be found at
8
-
<https://docs.ansible.com/ansible/latest/index.html>. It is only intended to provide a high-level overview and give you
8
+
[https://docs.ansible.com/ansible/latest/index.html](https://docs.ansible.com/ansible/latest/index.html). It is only intended to provide a high-level overview and give you
9
9
an idea where to find more detailed resources.
10
10
11
11
## Setting up your environment
12
12
13
13
When working with Ansible, you’ll probably want to set up a virtual environment so that you can install ansible and any
14
14
other Python modules necessary without contaminating your system Python installation. If you’ve never done this before,
15
-
this tutorial should help: <https://www.pythonforbeginners.com/basics/how-to-use-python-virtualenv/>. If you're an
15
+
this tutorial should help: [https://www.pythonforbeginners.com/basics/how-to-use-python-virtualenv/](https://www.pythonforbeginners.com/basics/how-to-use-python-virtualenv/). If you're an
16
16
experienced Python programmer and want to use `pipenv` or another alternative, that's perfectly fine too. It is
17
17
recommended that you use Python 3 as your Python binary.
@@ -56,7 +56,7 @@ specify the different components you want to use like driver, linter, verifier,
56
56
specify the AMI, instance type, and subnet. The Molecule driver docs above have more details on what can be set here.
57
57
58
58
Of special note is that for systemd-based docker images, you will need to use a few extra configuration options; the
59
-
bottom of the docker driver docs (<https://molecule.readthedocs.io/en/latest/configuration.html#docker>) has more details.
59
+
bottom of the docker driver docs ([https://molecule.readthedocs.io/en/latest/configuration.html#docker](https://molecule.readthedocs.io/en/latest/configuration.html#docker)) has more details.
60
60
Since most modern Linux distributions use systemd, you’ll probably need to use this.
61
61
62
62
If you have other Ansible roles your role is dependent on, be sure to specify this in the `meta/main.yml` file in your
@@ -77,7 +77,7 @@ If this works, you know that at least the Molecule parts are working right.
77
77
### Testing in EC2
78
78
79
79
With EC2, there a couple of other steps you’ll need to take. First, you’ll have to define an EC2_REGION environment
80
-
variable like so (this is due to the error described here: <https://github.com/ansible/molecule/issues/1570>):
80
+
variable like so (this is due to the error described here: [https://github.com/ansible/molecule/issues/1570](https://github.com/ansible/molecule/issues/1570)):
81
81
82
82
> `export EC2_REGION=”us-west-2”`
83
83
@@ -117,7 +117,7 @@ instances so I could poke around in them when something wasn’t working.
117
117
By default, Molecule is not testing anything other than the accuracy of your Ansible code -- is it written right and
118
118
does it run without generating errors. This doesn’t tell you if it’s actually doing what you want it to, though. For
119
119
that, you’ll need to write additional tests. By default, these use Test-Infra
120
-
(<https://testinfra.readthedocs.io/en/latest/>); you’ll put these in the `molecule/scenario_name/tests` directory. You
120
+
([https://testinfra.readthedocs.io/en/latest/](https://testinfra.readthedocs.io/en/latest/)); you’ll put these in the `molecule/scenario_name/tests` directory. You
121
121
should see a `test_default.py` file there already; this test is an example that just makes sure the `/etc/hosts` file
122
122
and root user exist, which is a bare minimum for things to actually work.
0 commit comments