Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
031f7ab9
Commit
031f7ab9
authored
Jun 17, 2016
by
Arbab Nazar
Committed by
GitHub
Jun 17, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3134 from edx/arbab/aws-rewrite
use fully expanded YAML dictionaries for ansible tasks
parents
658f6566
0b2af04c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
59 deletions
+71
-59
playbooks/roles/aws/tasks/main.yml
+71
-59
No files found.
playbooks/roles/aws/tasks/main.yml
View file @
031f7ab9
...
...
@@ -24,71 +24,80 @@
#
# Start dealing with Jumbo frames issue in mixed MTU deployements in AWS
#
-
name
:
g
ather ec2 facts for use in other roles
-
name
:
G
ather ec2 facts for use in other roles
action
:
ec2_facts
tags
:
-
deploy
-
shell
:
>
/sbin/ifconfig eth0 mtu 1500 up
-
name
:
Set the MTU to 1500 temporarily
shell
:
/sbin/ifconfig eth0 mtu 1500 up
when
:
ansible_distribution in common_debian_variants
-
name
:
check for eth0.cfg
stat
:
path=/etc/network/interfaces.d/eth0.cfg
-
name
:
Check for eth0.cfg
stat
:
path
:
/etc/network/interfaces.d/eth0.cfg
register
:
eth0_cfg
when
:
ansible_distribution in common_debian_variants
-
lineinfile
:
>
dest=/etc/network/interfaces.d/eth0.cfg
regexp="^post-up /sbin/ifconfig eth0 mtu 1500"
line="post-up /sbin/ifconfig eth0 mtu 1500"
insertafter="^iface"
-
name
:
Set the MTU to 1500 inside eth0.cfg file
lineinfile
:
dest
:
/etc/network/interfaces.d/eth0.cfg
regexp
:
"
^post-up
/sbin/ifconfig
eth0
mtu
1500"
line
:
"
post-up
/sbin/ifconfig
eth0
mtu
1500"
insertafter
:
"
^iface"
when
:
ansible_distribution in common_debian_variants and eth0_cfg.stat.exists
#
# End dealing with Jumbo frames issue in mixed MTU deployements in AWS
#
-
name
:
create all service directories
file
:
>
path="{{ item.value.path }}"
state="directory"
owner="{{ item.value.owner }}"
group="{{ item.value.group }}"
mode="{{ item.value.mode }}"
with_dict
:
aws_dirs
-
name
:
install system packages
apt
:
>
pkg={{','.join(aws_debian_pkgs)}}
state=present
update_cache=yes
-
name
:
Create all service directories
file
:
path
:
"
{{
item.value.path
}}"
state
:
directory
owner
:
"
{{
item.value.owner
}}"
group
:
"
{{
item.value.group
}}"
mode
:
"
{{
item.value.mode
}}"
with_dict
:
"
{{
aws_dirs
}}"
-
name
:
Install system packages
apt
:
name
:
"
{{
item
}}"
state
:
present
update_cache
:
yes
with_items
:
"
{{
aws_debian_pkgs
}}"
when
:
ansible_distribution in common_debian_variants
-
name
:
install aws python packages
pip
:
>
name="{{ item }}" state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
with_items
:
aws_pip_pkgs
-
name
:
Install aws python packages
pip
:
name
:
"
{{
item
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
with_items
:
"
{{
aws_pip_pkgs
}}"
-
name
:
create s3 log sync script
template
:
>
dest={{ aws_s3_sync_script }}
src=send-logs-to-s3.j2 mode=0755 owner=root group=root
-
name
:
Create s3 log sync script
template
:
dest
:
"
{{
aws_s3_sync_script
}}"
src
:
send-logs-to-s3.j2
mode
:
0755
owner
:
root
group
:
root
when
:
AWS_S3_LOGS
-
name
:
c
reate symlink for s3 log sync script
file
:
>
state
=
link
src
={{ aws_s3_sync_script }}
dest
={{ COMMON_BIN_DIR }}/{{ aws_s3_sync_script|basename }}
-
name
:
C
reate symlink for s3 log sync script
file
:
state
:
link
src
:
"
{{
aws_s3_sync_script
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
aws_s3_sync_script|basename
}}"
when
:
AWS_S3_LOGS
-
name
:
force logrotate on supervisor stop
template
:
>
src=etc/init/sync-on-stop.conf.j2
dest=/etc/init/sync-on-stop.conf
owner=root group=root mode=0644
-
name
:
Force logrotate on supervisor stop
template
:
src
:
etc/init/sync-on-stop.conf.j2
dest
:
/etc/init/sync-on-stop.conf
owner
:
root
group
:
root
mode
:
0644
when
:
AWS_S3_LOGS
# update the ssh motd on Ubuntu
...
...
@@ -96,25 +105,24 @@
# and add a custom motd. These do not require an
# ssh restart
# Only needed for EC2 instances.
-
name
:
u
pdate the ssh motd on Ubuntu
file
:
>
mode=0644
path={{ item }}
when
:
vagrant_home_dir.stat.exists ==
false
-
name
:
U
pdate the ssh motd on Ubuntu
file
:
path
:
"
{{
item
}}"
mode
:
0644
when
:
(vagrant_home_dir.stat.exists ==
false
) and (ansible_distribution in common_debian_variants)
with_items
:
-
"
/etc/update-motd.d/10-help-text"
-
"
/usr/share/landscape/landscape-sysinfo.wrapper"
-
"
/etc/update-motd.d/51-cloudguest"
-
"
/etc/update-motd.d/91-release-upgrade"
when
:
ansible_distribution in common_debian_variants
-
"
/etc/update-motd.d/10-help-text"
-
"
/usr/share/landscape/landscape-sysinfo.wrapper"
-
"
/etc/update-motd.d/51-cloudguest"
-
"
/etc/update-motd.d/91-release-upgrade"
-
name
:
u
pdate /etc/dhcp/dhclient.conf
-
name
:
U
pdate /etc/dhcp/dhclient.conf
template
:
src
:
etc/dhcp/dhclient.conf.j2
dest
:
/etc/dhcp/dhclient.conf
when
:
COMMON_CUSTOM_DHCLIENT_CONFIG
-
name
:
c
opy the MOTD template in place
-
name
:
C
opy the MOTD template in place
template
:
dest
:
"
{{
item.dest
}}"
src
:
"
{{
item.src
}}"
...
...
@@ -140,14 +148,18 @@
line
:
"
PasswordAuthentication
{{
COMMON_SSH_PASSWORD_AUTH
}}"
register
:
sshd_config
-
name
:
restart ssh
service
:
name=ssh state=restarted
-
name
:
Restart ssh
service
:
name
:
ssh
state
:
restarted
become
:
True
when
:
sshd_config.changed
when
:
ansible_distribution in common_debian_variants
-
name
:
restart ssh
service
:
name=sshd state=restarted
-
name
:
Restart ssh
service
:
name
:
sshd
state
:
restarted
become
:
True
when
:
sshd_config.changed
when
:
ansible_distribution in common_redhat_variants
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment