Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
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
Ansible
Roles
cloud
Commits
c8a25a78
Commit
c8a25a78
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-playbooks/general#85 Linting [skip-ci]
parent
fe244ad2
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tasks/cleanup.yml
+8
-8
8 additions, 8 deletions
tasks/cleanup.yml
tasks/ec2/inithost.yml
+12
-9
12 additions, 9 deletions
tasks/ec2/inithost.yml
tasks/ec2/inithostip.yml
+8
-8
8 additions, 8 deletions
tasks/ec2/inithostip.yml
tasks/main.yml
+2
-2
2 additions, 2 deletions
tasks/main.yml
with
30 additions
and
27 deletions
tasks/cleanup.yml
+
8
−
8
View file @
c8a25a78
...
...
@@ -3,26 +3,26 @@
-
name
:
Remove host from known_hosts
known_hosts
:
name
="
{{ item }}
"
state
="
absent
"
name
:
'
{{
item
}}
'
state
:
absent
with_items
:
-
{{
static_ipv4|default(false)
}}
-
{{
host
}}
-
name
:
Remove host from hosts file
1
lineinfile
:
dest
=
/etc/hosts
regexp
=
'{{ item }}'
state
=
absent
dest
:
/etc/hosts
regexp
:
'
{{
item
}}'
state
:
absent
become
:
yes
with_items
:
-
^{{ static_ipv4|default(false) }}
-
name
:
Remove host from hosts file
2
lineinfile
:
dest
=
/etc/hosts
regexp
=
'{{ item }}'
state
=
absent
dest
:
/etc/hosts
regexp
:
'
{{
item
}}'
state
:
absent
become
:
yes
with_items
:
-
.* {{ host }}$
This diff is collapsed.
Click to expand it.
tasks/ec2/inithost.yml
+
12
−
9
View file @
c8a25a78
...
...
@@ -6,7 +6,10 @@
-
name
:
Create the new instance
ec2
:
instance_tags
:
{
"
Name"
:
"
Ansible-Host-{{
host
}}"
,
"
AnsibleHost"
:
"
{{
host
}}"
,
"
AnsibleGroups"
:
"
{{
initgroups
}}"
}
instance_tags
:
Name
:
Ansible-Host-{{ host }}
AnsibleHost
:
'
{{
host
}}'
AnsibleGroups
:
'
{{
initgroups
}}'
assign_public_ip
:
yes
group_id
:
"
{{
ec2_group_id
}}"
key_name
:
"
{{
ec2_key_name
}}"
...
...
@@ -28,15 +31,15 @@
-
block
:
-
name
:
Associate an elastic IP with the new instance
ec2_eip
:
device_id
:
"
{{
item
}}"
public_ip
:
'
{{
inithostip
}}'
region
:
"
{{
ec2_region
}}"
state
:
present
with_items
:
'
{{
ec2.instance_ids
}}'
-
name
:
Associate an elastic IP with the new instance
ec2_eip
:
device_id
:
"
{{
item
}}"
public_ip
:
'
{{
inithostip
}}'
region
:
"
{{
ec2_region
}}"
state
:
present
with_items
:
'
{{
ec2.instance_ids
}}'
-
import_tasks
:
inithostip.yml hostip='{{ inithostip }}'
-
import_tasks
:
inithostip.yml hostip='{{ inithostip }}'
when
:
inithostip is defined
...
...
This diff is collapsed.
Click to expand it.
tasks/ec2/inithostip.yml
+
8
−
8
View file @
c8a25a78
...
...
@@ -3,14 +3,14 @@
-
name
:
Add new instance(s) to the inventory
add_host
:
hostname
="
{{ host }}
"
static_ipv4
="
{{ hostip }}
"
groups
="
{{ initgroups }}
"
hostname
:
'
{{
host
}}
'
static_ipv4
:
'
{{
hostip
}}
'
groups
:
'
{{
initgroups
}}
'
-
name
:
Waiting for SSH service becoming available
wait_for
:
host
="
{{ hostip }}
"
port
=
22
delay
=
10
timeout
=
120
state
=
present
host
:
'
{{
hostip
}}
'
port
:
22
delay
:
10
timeout
:
120
state
:
present
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
2
−
2
View file @
c8a25a78
...
...
@@ -9,8 +9,8 @@
-
block
:
-
import_tasks
:
"
{{
cloud|default('none')
}}/{{
mode
}}.yml"
-
import_tasks
:
"
{{
cloud|default('none')
}}/{{
mode
}}.yml"
-
import_tasks
:
"
{{
mode
}}.yml"
-
import_tasks
:
"
{{
mode
}}.yml"
when
:
not excluded_roles or "cloud" not in excluded_roles
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