Skip to content

Commit 3054443

Browse files
committed
update docs
1 parent fd81896 commit 3054443

File tree

3 files changed

+144
-7
lines changed

3 files changed

+144
-7
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
## Debugging Ansible Automation for AEM
2+
3+
Hints for debugging the [Automation for AEM][ansible-aem].
4+
5+
6+
### Ansible verbose mode
7+
8+
Ansible Commands support the verbose flag
9+
10+
```
11+
-v # simple verbose output
12+
-vv # more verbose
13+
-vvv # even more verbose
14+
-vvvv # connection debugging
15+
-vvvvv # even more verbose, and so on
16+
```
17+
18+
Which each added "v" the verbosity increases (and the readability decreases).
19+
20+
It is recommened to write the output to a file like:
21+
22+
```
23+
ansible-playbook playbook-setup-prod.yml | tee ansible.log
24+
```
25+
26+
### Use \-\-skip-tags
27+
28+
If you want to speed up debugging and want to skip the tasks/roles that are working use the parameter
29+
30+
```
31+
--skip-tags aem-cms,aem-dispatcher
32+
```
33+
34+
When working with the Conga Ansible IT Automation it is recommended to skip the compile process of the wcm_io_devops.conga_maven role to save time
35+
36+
```
37+
--skip-tags conga-maven-compile
38+
```
39+
40+
For more information refer to: https://docs.ansible.com/ansible/2.6/user_guide/playbooks_tags.html
41+
42+
### Use \-\-start-at-task
43+
44+
If you want to start the playbook at a particula task you can use the --start-at-task option:
45+
46+
```
47+
ansible-playbook playbook-setup-prod.yml --start-at-task="Download AEM quickstart."
48+
```
49+
50+
### Execute interactively
51+
52+
If you want to inspect the result of each task you can run the playbook with the --step option:
53+
54+
```
55+
ansible-playbook playbook-setup-prod.yml --step
56+
```
57+
58+
This will cause Ansible to stop on each task if it should execute that task.
59+
60+
### Enable debug logs
61+
62+
Ansible is for example hiding the Maven log output. When an error occurs the log-output will be shown.
63+
64+
#### wcm_io_devops.conga_aem_packages
65+
66+
This role supports the logging of the current maven output to a file which then can be "tailed".
67+
68+
Refer to:
69+
70+
* https://github.com/wcm-io-devops/ansible-conga-aem-packages and
71+
* https://github.com/wcm-io-devops/ansible-conga-aem-packages/blob/master/defaults/main.yml#L27-L31
72+
73+
For more information.
74+
75+
## Advanced Debugging
76+
77+
### Manipulating Roles
78+
79+
Ansible looks per default in the following pathes to search for roles
80+
81+
* `roles` directory, relative to the playbook file.
82+
* By default, in `/etc/ansible/roles`
83+
84+
This behavior becomes handy when you want to debug a role in your current project.
85+
86+
#### Example for wcm_io_devops.conga_aem_packages role
87+
88+
_Prepare role for local manipulation_
89+
```
90+
# switch into the ansible playbook dir
91+
mkdir roles && cd roles
92+
git clone https://github.com/wcm-io-devops/ansible-conga-aem-packages.git && git checkout 1.0.0
93+
```
94+
95+
With this setup the role "wcm_io_devops.conga_aem_packages" will be loaded from the roles directory.
96+
97+
You can then start manipulating the role e.g. by adding debug statements, manual inputs and fail statements to avoid continuing of the play.
98+
99+
_Example: Output content of conga_config and continue_
100+
101+
```yaml
102+
- name: Debug conga_config
103+
debug:
104+
msg:
105+
- conga_config
106+
- "{{ conga_config }}"
107+
108+
- fail:
109+
msg: do not continue
110+
```
111+
112+
_Example: Wait for user input_
113+
114+
```yaml
115+
- name: "Wait for user input"
116+
prompt: "Continue?"
117+
```
118+
119+
Links:
120+
121+
* https://docs.ansible.com/ansible/2.6/modules/fail_module.html
122+
* https://docs.ansible.com/ansible/2.6/modules/debug_module.html
123+
* https://docs.ansible.com/ansible/2.6/user_guide/playbooks_prompts.html
124+
125+
126+
### Playbook Debugger
127+
128+
When you are using Ansible 2.5+ you can use the Playbook Debugger<br/>
129+
https://docs.ansible.com/ansible/2.5/user_guide/playbooks_debugger.html
130+
131+
132+
[ansible-aem]: http://devops.wcm.io/ansible-aem/

public_site/src/site/markdown/ansible.md renamed to public_site/src/site/markdown/ansible-aem/index.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ wcm.io DevOps provides a set of [Ansible][ansible] roles to automate infrastruct
44

55
The Ansible roles are optimized to be used together with [CONGA][conga], but some can also be used standalone.
66

7-
A good starting point for setting up AEM projects for deployment automation with CONGA and Ansible is using the [wcm.io Maven Archetype for AEM Configuration Management][aem-configmgmt-archetype].
7+
A good starting point for setting up AEM projects for deployment automation with CONGA and Ansible is using the<br/>
8+
[wcm.io Maven Archetype for AEM Configuration Management][aem-configmgmt-archetype].
9+
10+
If anything goes wrong, have a look at [Debugging Ansible Automation for AEM][ansible-debugging].
811

912

1013
### Roles on Ansible Galaxy
@@ -17,15 +20,17 @@ The Ansible roles are published on Ansibe Galaxy:
1720

1821
### Further Resources
1922

20-
* [Automate AEM Deployment with Ansible and wcm.io CONGA][adaptto-talk-aem-ansible] - Talk from adaptTo() 2017
21-
* [Maven Archetypes for AEM][adaptto-talk-aem-archetypes] - Talk from adaptTo() 2018 about AEM project archetypes including Ansible/CONGA-based cloud deployment
23+
* [adaptTo() 2017 Talk: Automate AEM Deployment with Ansible and wcm.io CONGA][adaptto-talk-2017-aem-ansible]
24+
* [adaptTo() 2018 Talk: Maven Archetypes for AEM][adaptto-talk-2018-aem-archetypes] - about AEM project archetypes including Ansible/CONGA-based cloud deployment
25+
* [Debugging Ansible Automation for AEM][ansible-debugging]
2226

2327

2428

2529
[ansible]: https://www.ansible.com/
30+
[ansible-debugging]: ansible-debugging.html
2631
[conga]: http://devops.wcm.io/conga
2732
[aem-configmgmt-archetype]: http://wcm.io/tooling/maven/archetypes/aem-confmgmt/
2833
[ansible-galaxy-roles]: https://galaxy.ansible.com/wcm_io_devops
2934
[github-ansible-roles]: https://github.com/wcm-io-devops?q=topic%3Aansible-role
30-
[adaptto-talk-aem-ansible]: https://adapt.to/2017/en/schedule/automate-aem-deployment-with-ansible-and-wcm-io-conga.html
31-
[adaptto-talk-aem-archetypes]: https://adapt.to/2018/en/schedule/maven-archetypes-for-aem.html
35+
[adaptto-talk-2017-aem-ansible]: https://adapt.to/2017/en/schedule/automate-aem-deployment-with-ansible-and-wcm-io-conga.html
36+
[adaptto-talk-2018-aem-archetypes]: https://adapt.to/2018/en/schedule/maven-archetypes-for-aem.html

public_site/src/site/markdown/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ wcm.io DevOps is an Open Source project which provides tools for configuration m
1212

1313
##### CI/CD and IT Automation
1414

15-
* [Ansible Automation for AEM](ansible.html)
15+
* [Ansible Automation for AEM](ansible-aem/)
1616
* [Jenkins Pipeline Library for CI/CD](https://github.com/wcm-io-devops/jenkins-pipeline-library)
1717

1818
##### Maven
1919

2020
* [Maven NodeJS Proxy](https://github.com/wcm-io-devops/maven-nodejs-proxy)
21-
* [Maven Eclipse Plugin (Fork)](https://github.com/wcm-io-devops/maven-eclipse-plugin)
21+
* [Eclipse Maven Plugin](https://github.com/wcm-io-devops/maven-eclipse-plugin)
2222

2323
##### UI Tools
2424

0 commit comments

Comments
 (0)