Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible-TP3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
fabian.troller
Ansible-TP3
Commits
856ea2d1
Commit
856ea2d1
authored
2 years ago
by
poulpe
Browse files
Options
Downloads
Patches
Plain Diff
[Update] Fix standalone run
parent
977eda2f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Config_H1_Ping_H2.yml
+18
-28
18 additions, 28 deletions
Config_H1_Ping_H2.yml
with
18 additions
and
28 deletions
Config_H1_Ping_H2.yml
+
18
−
28
View file @
856ea2d1
...
@@ -3,14 +3,10 @@
...
@@ -3,14 +3,10 @@
hosts
:
all
hosts
:
all
become
:
true
become
:
true
tasks
:
tasks
:
-
name
:
Load the variables
include_vars
:
variables.yml
-
name
:
Rename hosts
-
name
:
Rename hosts
command
:
hostnamectl set-hostname {{ inventory_hostname }}
command
:
hostnamectl set-hostname {{ inventory_hostname }}
notify
:
rename_finish
handlers
:
-
name
:
rename_finish
debug
:
msg
:
"
I
can
handle
dates"
-
name
:
Setup network for Hosts
-
name
:
Setup network for Hosts
hosts
:
hotes
hosts
:
hotes
...
@@ -18,11 +14,16 @@
...
@@ -18,11 +14,16 @@
tasks
:
tasks
:
-
name
:
"
Create
file
interface
in
interfaces.d"
-
name
:
"
Create
file
interface
in
interfaces.d"
ansible.builtin.template
:
ansible.builtin.template
:
src
:
./
interfaces_H
.j2
src
:
./
templates/host_config_template
.j2
dest
:
/etc/network/interfaces.d/interfaces_playbook.conf
dest
:
/etc/network/interfaces.d/interfaces_playbook.conf
mode
:
0640
mode
:
0640
-
name
:
Restart interfaces hosts
notify
:
Restart network
shell
:
"
ifdown
--force
eth0"
handlers
:
-
name
:
Restart network
ansible.builtin.service
:
name
:
networking
state
:
restarted
enabled
:
yes
-
name
:
Setup network for Routers
-
name
:
Setup network for Routers
hosts
:
routeurs
hosts
:
routeurs
...
@@ -30,30 +31,19 @@
...
@@ -30,30 +31,19 @@
tasks
:
tasks
:
-
name
:
"
Create
file
interface
in
interfaces.d"
-
name
:
"
Create
file
interface
in
interfaces.d"
ansible.builtin.template
:
ansible.builtin.template
:
src
:
./
interfaces_R
.j2
src
:
./
templates/router_config_template
.j2
dest
:
/etc/network/interfaces.d/interfaces_playbook.conf
dest
:
/etc/network/interfaces.d/interfaces_playbook.conf
mode
:
0640
mode
:
0640
notify
:
Restart network
-
name
:
"
Set
ip_forwarding
to
1"
-
name
:
"
Set
ip_forwarding
to
1"
ansible.posix.sysctl
:
ansible.posix.sysctl
:
name
:
net.ipv4.ip_forward
name
:
net.ipv4.ip_forward
value
:
'
1'
value
:
'
1'
sysctl_set
:
true
sysctl_set
:
true
state
:
present
state
:
present
-
name
:
Restart interfaces hosts
shell
:
"
ifdown
--force
eth0
eth1"
-
name
:
Configuration et démarrage des interfaces réseau
hosts
:
all
become
:
true
tasks
:
-
name
:
Restart interfaces hosts
shell
:
"
ifup
-a
--ignore-errors"
notify
:
start network
handlers
:
handlers
:
-
name
:
start network
-
name
:
Re
start network
service
:
ansible.builtin.
service
:
name
:
networking
name
:
networking
state
:
restarted
state
:
restarted
enabled
:
yes
enabled
:
yes
...
...
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