Commit 27de59bf by e0d

wip

parent d8d74e56
...@@ -61,10 +61,6 @@ ...@@ -61,10 +61,6 @@
user: user:
name={{ automated_user }} state=present shell=/bin/rbash name={{ automated_user }} state=present shell=/bin/rbash
home={{ automated_home }} createhome=yes home={{ automated_home }} createhome=yes
tags:
- automated
- install
- update
- name: create sudoers file from file - name: create sudoers file from file
copy: copy:
...@@ -72,10 +68,6 @@ ...@@ -72,10 +68,6 @@
src={{ automated_sudoers_file }} owner="root" src={{ automated_sudoers_file }} owner="root"
group="root" mode=0440 validate='visudo -cf %s' group="root" mode=0440 validate='visudo -cf %s'
when: automated_sudoers_file when: automated_sudoers_file
tags:
- automated
- install
- update
- name: create sudoers file from template - name: create sudoers file from template
template: template:
...@@ -83,10 +75,6 @@ ...@@ -83,10 +75,6 @@
src={{ automated_sudoers_template }} owner="root" src={{ automated_sudoers_template }} owner="root"
group="root" mode=0440 validate='visudo -cf %s' group="root" mode=0440 validate='visudo -cf %s'
when: automated_sudoers_template when: automated_sudoers_template
tags:
- automated
- install
- update
# #
# Prevent user from updating their PATH and # Prevent user from updating their PATH and
...@@ -96,10 +84,6 @@ ...@@ -96,10 +84,6 @@
file: file:
path={{ automated_home }}/{{ item }} mode=0640 path={{ automated_home }}/{{ item }} mode=0640
state=file owner="root" group={{ automated_user }} state=file owner="root" group={{ automated_user }}
tags:
- automated
- install
- update
with_items: with_items:
- .bashrc - .bashrc
- .profile - .profile
...@@ -109,10 +93,6 @@ ...@@ -109,10 +93,6 @@
file: file:
path={{ automated_home }} mode=0750 state=directory path={{ automated_home }} mode=0750 state=directory
owner="root" group={{ automated_user }} owner="root" group={{ automated_user }}
tags:
- automated
- install
- update
# #
# This ensures that the links are updated with each run # This ensures that the links are updated with each run
...@@ -123,19 +103,11 @@ ...@@ -123,19 +103,11 @@
file: file:
path={{ automated_home }}/bin state=absent path={{ automated_home }}/bin state=absent
ignore_errors: yes ignore_errors: yes
tags:
- automated
- install
- update
- name: create ~automated/bin directory - name: create ~automated/bin directory
file: file:
path={{ automated_home }}/bin state=directory mode=0750 path={{ automated_home }}/bin state=directory mode=0750
owner="root" group={{ automated_user }} owner="root" group={{ automated_user }}
tags:
- automated
- install
- update
- name: re-write .profile - name: re-write .profile
copy: copy:
...@@ -144,10 +116,6 @@ ...@@ -144,10 +116,6 @@
owner="root" owner="root"
group={{ automated_user }} group={{ automated_user }}
mode="0744" mode="0744"
tags:
- automated
- install
- update
- name: re-write .bashrc - name: re-write .bashrc
copy: copy:
...@@ -156,36 +124,21 @@ ...@@ -156,36 +124,21 @@
owner="root" owner="root"
group={{ automated_user }} group={{ automated_user }}
mode="0744" mode="0744"
tags:
- automated
- install
- update
- name: create .ssh directory - name: create .ssh directory
file: file:
path={{ automated_home }}/.ssh state=directory mode=0700 path={{ automated_home }}/.ssh state=directory mode=0700
owner={{ automated_user }} group={{ automated_user }} owner={{ automated_user }} group={{ automated_user }}
tags:
- automated - name: add authorized_keys
- install lineinfile:
- update line="{{ item }}" state=present
- name: copy key to .ssh/authorized_keys
copy:
src=home/automator/.ssh/authorized_keys
dest={{ automated_home }}/.ssh/authorized_keys mode=0600 dest={{ automated_home }}/.ssh/authorized_keys mode=0600
owner={{ automated_user }} group={{ automated_user }} owner={{ automated_user }} group={{ automated_user }}
tags: with_items: EDXAPP_AUTOMATOR_AUTHORIZED_KEYS
- automated
- install
- update
- name: create allowed command links - name: create allowed command links
file: file:
src={{ item }} dest={{ automated_home }}/bin/{{ item.split('/').pop() }} src={{ item }} dest={{ automated_home }}/bin/{{ item.split('/').pop() }}
state=link state=link
with_items: automated_rbash_links with_items: automated_rbash_links
tags: \ No newline at end of file
- automated
- install
- update
...@@ -123,6 +123,10 @@ EDXAPP_PYTHON_SANDBOX: false ...@@ -123,6 +123,10 @@ EDXAPP_PYTHON_SANDBOX: false
# it puts the sandbox in 'complain' mode, for reporting but not enforcement # it puts the sandbox in 'complain' mode, for reporting but not enforcement
EDXAPP_SANDBOX_ENFORCE: true EDXAPP_SANDBOX_ENFORCE: true
# Supply authorized keys used for remote management via the automated
# role, see meta/main.yml. Ensure you know what this does before
# enabling.
EDXAPP_AUTOMATOR_AUTHORIZED_KEYS: []
#-------- Everything below this line is internal to the role ------------ #-------- Everything below this line is internal to the role ------------
...@@ -497,3 +501,5 @@ edxapp_cms_variant: cms ...@@ -497,3 +501,5 @@ edxapp_cms_variant: cms
# Worker Settings # Worker Settings
worker_django_settings_module: 'aws' worker_django_settings_module: 'aws'
edxapp_automated_rbash_links:
- /usr/bin/sudo
\ No newline at end of file
...@@ -6,3 +6,7 @@ dependencies: ...@@ -6,3 +6,7 @@ dependencies:
rbenv_dir: "{{ edxapp_app_dir }}" rbenv_dir: "{{ edxapp_app_dir }}"
rbenv_ruby_version: "{{ edxapp_ruby_version }}" rbenv_ruby_version: "{{ edxapp_ruby_version }}"
- devpi - devpi
- role: automated
automated_rbash_links: "{{ edxapp_automated_rbash_links }}"
automated_sudoers_dest: '99-automator-edxapp'
automated_sudoers_template: 'roles/edxapp/templates/etc/sudoers.d/99-automator-edxapp.j2'
automator ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ edxapp_venv_dir }}/bin/django-admin.py migrate *
automator ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ edxapp_venv_dir }}/bin/django-admin.py seed_permissions_roles *
automator ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ edxapp_venv_dir }}/bin/django-admin.py set_staff *
automator ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ edxapp_venv_dir }}/bin/django-admin.py transfer_students *
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment