Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blog.limos.fr
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent MAZENOD
blog.limos.fr
Commits
e2835961
Commit
e2835961
authored
6 years ago
by
Vincent Mazenod
Browse files
Options
Downloads
Patches
Plain Diff
reorder ansible
parent
184249cb
No related branches found
No related tags found
No related merge requests found
Pipeline
#3503
passed
6 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
content/slides/cri/md/ansible.md
+46
-46
46 additions, 46 deletions
content/slides/cri/md/ansible.md
with
46 additions
and
46 deletions
content/slides/cri/md/ansible.md
+
46
−
46
View file @
e2835961
...
...
@@ -649,6 +649,52 @@ post_tasks:
```
## tags
tags au niveau tâches
```
yaml
-
name
:
MySQL to listen on all interfaces, not just localhost
lineinfile
:
dest
:
/etc/mysql/mariadb.conf.d/50-server.cnf
regexp
:
"
^bind-address
=
127.0.0.1"
line
:
"
#bind-address
=
127.0.0.1"
tags
:
[
database
]
```
`always`
tag spécial exécuté à tous les coups
```
yaml
pre_tasks
:
-
name
:
update sources
apt
:
update_cache
:
yes
tags
:
[
always
]
```
## tags
```
shell
$
ansible-playbook my-playbook.yml
--list-tags
```
liste tous les tags disponibles dans le playbook
```
shell
$
ansible-playbook my-playbook.yml
--tags
database
```
n'exécute que les tâches du playbook ayant un tag
`database`
```
shell
$
ansible-playbook my-playbook.yml
--skip-tags
database
```
exécute toutes les tâches du playbook sauf celles ayant un tag
`database`
## dry run
```
shell
...
...
@@ -762,52 +808,6 @@ $ ansible-galaxy install -f -r requirements.yml
```
## tags
tags au niveau tâches
```
yaml
-
name
:
MySQL to listen on all interfaces, not just localhost
lineinfile
:
dest
:
/etc/mysql/mariadb.conf.d/50-server.cnf
regexp
:
"
^bind-address
=
127.0.0.1"
line
:
"
#bind-address
=
127.0.0.1"
tags
:
[
database
]
```
tags au niveau roles à l'inclusion dans le playbook
```
yaml
roles
:
-
role
:
debug
tags
:
debug
```
`always`
tag spécial exécuté à tous les coups
## tags
```
shell
$
ansible-playbook my-playbook.yml
--list-tags
```
liste tous les tags disponibles dans le playbook
```
shell
$
ansible-playbook my-playbook.yml
--tags
debug
```
n'exécute que les tâches du playbook ayant un tag
`debug`
```
shell
$
ansible-playbook my-playbook.yml
--skip-tags
debug
```
exécute toutes les tâches du playbook sauf celles ayant un tag
`debug`
## [<i class="fa fa-book" aria-hidden="true"></i> callback](https://docs.ansible.com/ansible/latest/plugins/callback.html)
```
shell
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment