Commit 3802db51 by Feanil Patel

Add jinja syntax to with_items.

parent dfc18924
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
shell: '{{ COMMAND_PREFIX }} {{ SUB_APPLICATION_NAME }} show_unapplied_migrations --database "{{ item }}" --output_file "{{ temp_output_dir.stdout }}/{{ item }}_{{ migration_plan }}" --settings "{{ EDX_PLATFORM_SETTINGS }}"' shell: '{{ COMMAND_PREFIX }} {{ SUB_APPLICATION_NAME }} show_unapplied_migrations --database "{{ item }}" --output_file "{{ temp_output_dir.stdout }}/{{ item }}_{{ migration_plan }}" --settings "{{ EDX_PLATFORM_SETTINGS }}"'
become_user: "{{ APPLICATION_USER }}" become_user: "{{ APPLICATION_USER }}"
when: APPLICATION_NAME == "edxapp" and item != "read_replica" when: APPLICATION_NAME == "edxapp" and item != "read_replica"
with_items: edxapp_databases.keys() with_items: "{{ edxapp_databases.keys() }}"
- name: migrate to apply any unapplied migrations - name: migrate to apply any unapplied migrations
shell: '{{ COMMAND_PREFIX }} run_migrations --output_file "{{ temp_output_dir.stdout }}/{{ migration_result }}"' shell: '{{ COMMAND_PREFIX }} run_migrations --output_file "{{ temp_output_dir.stdout }}/{{ migration_result }}"'
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
shell: '{{ COMMAND_PREFIX }} {{ SUB_APPLICATION_NAME }} run_migrations --database "{{ item }}" --settings "{{ EDX_PLATFORM_SETTINGS }}" --output_file "{{ temp_output_dir.stdout }}/{{ migration_result }}"' shell: '{{ COMMAND_PREFIX }} {{ SUB_APPLICATION_NAME }} run_migrations --database "{{ item }}" --settings "{{ EDX_PLATFORM_SETTINGS }}" --output_file "{{ temp_output_dir.stdout }}/{{ migration_result }}"'
become_user: "{{ APPLICATION_USER }}" become_user: "{{ APPLICATION_USER }}"
when: APPLICATION_NAME == "edxapp" and item != "read_replica" when: APPLICATION_NAME == "edxapp" and item != "read_replica"
with_items: edxapp_databases.keys() with_items: "{{ edxapp_databases.keys() }}"
- name: List all migration files - name: List all migration files
action: "command ls -1 {{ temp_output_dir.stdout }}" action: "command ls -1 {{ temp_output_dir.stdout }}"
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
serial: "{{ serial_count }}" serial: "{{ serial_count }}"
pre_tasks: pre_tasks:
- action: ec2_facts - action: ec2_facts
- debug: var="{{ ansible_ec2_instance_id }}" - debug:
var: "{{ ansible_ec2_instance_id }}"
when: elb_pre_post when: elb_pre_post
- name: Instance De-register - name: Instance De-register
local_action: ec2_elb local_action: ec2_elb
...@@ -26,8 +27,9 @@ ...@@ -26,8 +27,9 @@
become: False become: False
when: elb_pre_post when: elb_pre_post
tasks: tasks:
- debug: msg="{{ ansible_ec2_local_ipv4 }}" - debug:
with_items: list.results var: "{{ ansible_ec2_local_ipv4 }}"
with_items: "{{ list.results }}"
- command: rabbitmqctl stop_app - command: rabbitmqctl stop_app
- command: rabbitmqctl join_cluster rabbit@ip-{{ hostvars.keys()[0]|replace('.', '-') }} - command: rabbitmqctl join_cluster rabbit@ip-{{ hostvars.keys()[0]|replace('.', '-') }}
when: hostvars.keys()[0] != ansible_ec2_local_ipv4 when: hostvars.keys()[0] != ansible_ec2_local_ipv4
...@@ -43,6 +45,6 @@ ...@@ -43,6 +45,6 @@
region: us-east-1 region: us-east-1
state: present state: present
wait_timeout: 60 wait_timeout: 60
with_items: ec2_elbs with_items: "{{ ec2_elbs }}"
become: False become: False
when: elb_pre_post when: elb_pre_post
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
region: us-east-1 region: us-east-1
state: present state: present
wait_timeout: 60 wait_timeout: 60
with_items: ec2_elbs with_items: "{{ ec2_elbs }}"
become: False become: False
when: elb_pre_post when: elb_pre_post
# #
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
login_host: "{{ item.login_host }}" login_host: "{{ item.login_host }}"
login_user: "{{ item.login_user }}" login_user: "{{ item.login_user }}"
login_password: "{{ item.login_password }}" login_password: "{{ item.login_password }}"
with_items: databases with_items: "{{ databases }}"
tags: tags:
- dbs - dbs
...@@ -74,6 +74,6 @@ ...@@ -74,6 +74,6 @@
login_user: "{{ item.login_user }}" login_user: "{{ item.login_user }}"
login_password: "{{ item.login_password }}" login_password: "{{ item.login_password }}"
append_privs: yes append_privs: yes
with_items: database_users with_items: "{{ database_users }}"
tags: tags:
- users - users
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
roles: "{{ item.roles }}" roles: "{{ item.roles }}"
state: present state: present
replica_set: "{{ repl_set }}" replica_set: "{{ repl_set }}"
with_items: MONGO_USERS with_items: "{{ MONGO_USERS }}"
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
manage_group {{ item.name | quote }} manage_group {{ item.name | quote }}
{% if item.get('permissions', []) | length %}--permissions {{ item.permissions | default([]) | map('quote') | join(' ') }}{% endif %} {% if item.get('permissions', []) | length %}--permissions {{ item.permissions | default([]) | map('quote') | join(' ') }}{% endif %}
{% if item.get('remove') %}--remove{% endif %} {% if item.get('remove') %}--remove{% endif %}
with_items: django_groups with_items: "{{ django_groups }}"
- name: Manage users - name: Manage users
shell: > shell: >
...@@ -98,6 +98,6 @@ ...@@ -98,6 +98,6 @@
{% if item.get('staff') %}--staff{% endif %} {% if item.get('staff') %}--staff{% endif %}
{% if item.get('unusable_password') %}--unusable-password{% endif %} {% if item.get('unusable_password') %}--unusable-password{% endif %}
{% if item.get('initial_password_hash') %}--initial-password-hash {{ item.initial_password_hash | quote }}{% endif %} {% if item.get('initial_password_hash') %}--initial-password-hash {{ item.initial_password_hash | quote }}{% endif %}
with_items: django_users with_items: "{{ django_users }}"
register: manage_users_result register: manage_users_result
failed_when: (manage_users_result | failed) and not (ignore_user_creation_errors | bool) failed_when: (manage_users_result | failed) and not (ignore_user_creation_errors | bool)
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
install_recommends: yes install_recommends: yes
force: yes force: yes
update_cache: yes update_cache: yes
with_items: mongodb_debian_pkgs with_items: "{{ mongodb_debian_pkgs }}"
- name: wait for mongo server to start - name: wait for mongo server to start
wait_for: wait_for:
port: 27017 port: 27017
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
install_recommends: yes install_recommends: yes
force: yes force: yes
update_cache: yes update_cache: yes
with_items: mongodb_debian_pkgs with_items: "{{ mongodb_debian_pkgs }}"
- name: wait for mongo server to start - name: wait for mongo server to start
wait_for: wait_for:
port: 27017 port: 27017
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
pre_tasks: pre_tasks:
- action: ec2_facts - action: ec2_facts
when: elb_pre_post when: elb_pre_post
- debug: var="{{ ansible_ec2_instance_id }}" - debug:
var: "{{ ansible_ec2_instance_id }}"
when: elb_pre_post when: elb_pre_post
- name: Instance De-register - name: Instance De-register
local_action: ec2_elb local_action: ec2_elb
...@@ -25,7 +26,8 @@ ...@@ -25,7 +26,8 @@
tasks: tasks:
- shell: echo "test" - shell: echo "test"
post_tasks: post_tasks:
- debug: var="{{ ansible_ec2_instance_id }}" - debug:
var: "{{ ansible_ec2_instance_id }}"
when: elb_pre_post when: elb_pre_post
- name: Register instance in the elb - name: Register instance in the elb
local_action: ec2_elb local_action: ec2_elb
...@@ -35,6 +37,6 @@ ...@@ -35,6 +37,6 @@
region: us-east-1 region: us-east-1
state: present state: present
wait_timeout: 60 wait_timeout: 60
with_items: ec2_elbs with_items: "{{ ec2_elbs }}"
become: False become: False
when: elb_pre_post when: elb_pre_post
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
pre_tasks: pre_tasks:
- action: ec2_facts - action: ec2_facts
when: elb_pre_post when: elb_pre_post
- debug: var="{{ ansible_ec2_instance_id }}" - debug:
var: "{{ ansible_ec2_instance_id }}"
when: elb_pre_post when: elb_pre_post
- name: Instance De-register - name: Instance De-register
local_action: ec2_elb local_action: ec2_elb
...@@ -38,7 +39,8 @@ ...@@ -38,7 +39,8 @@
- role: newrelic - role: newrelic
when: COMMON_ENABLE_NEWRELIC when: COMMON_ENABLE_NEWRELIC
post_tasks: post_tasks:
- debug: var="{{ ansible_ec2_instance_id }}" - debug:
var: "{{ ansible_ec2_instance_id }}"
when: elb_pre_post when: elb_pre_post
- name: Register instance in the elb - name: Register instance in the elb
local_action: ec2_elb local_action: ec2_elb
...@@ -48,6 +50,6 @@ ...@@ -48,6 +50,6 @@
region: us-east-1 region: us-east-1
state: present state: present
wait_timeout: 60 wait_timeout: 60
with_items: ec2_elbs with_items: "{{ ec2_elbs }}"
become: False become: False
when: elb_pre_post when: elb_pre_post
...@@ -66,7 +66,7 @@ tasks: ...@@ -66,7 +66,7 @@ tasks:
- name: tag my launched instances - name: tag my launched instances
local_action: ec2_tag resource={{ item.id }} region=eu-west-1 state=present local_action: ec2_tag resource={{ item.id }} region=eu-west-1 state=present
with_items: ec2.instances with_items: "{{ ec2.instances }}"
args: args:
tags: tags:
Name: webserver Name: webserver
...@@ -76,7 +76,7 @@ tasks: ...@@ -76,7 +76,7 @@ tasks:
tasks: tasks:
- name: tag my instance - name: tag my instance
local_action: ec2_ntag resource={{ item.id }} region=us-east-1 state=present local_action: ec2_ntag resource={{ item.id }} region=us-east-1 state=present
with_items: ec2.instances with_items: "{{ ec2.instances }}"
args: args:
tags: tags:
- Name: "{{ some_variable }}" - Name: "{{ some_variable }}"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
apt: apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: ad_hoc_reporting_debian_pkgs with_items: "{{ ad_hoc_reporting_debian_pkgs }}"
tags: tags:
- install:system-requirements - install:system-requirements
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
name: "{{ item }}" name: "{{ item }}"
state: present state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
with_items: ad_hoc_reporting_pip_pkgs with_items: "{{ ad_hoc_reporting_pip_pkgs }}"
tags: tags:
- install:app-requirements - install:app-requirements
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
- scripts - scripts
- scripts:mysql - scripts:mysql
- install:code - install:code
with_items: AD_HOC_REPORTING_REPLICA_DB_HOSTS with_items: "{{ AD_HOC_REPORTING_REPLICA_DB_HOSTS }}"
# These templates rely on there being a global # These templates rely on there being a global
# read_only mongo user, you must override the default # read_only mongo user, you must override the default
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
owner: "{{ item.owner }}" owner: "{{ item.owner }}"
group: "{{ item.group }}" group: "{{ item.group }}"
mode: "{{ item.mode | default('0755') }}" mode: "{{ item.mode | default('0755') }}"
with_items: dirs with_items: "{{ dirs }}"
when: dirs is defined when: dirs is defined
tags: tags:
- install - install
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
virtualenv: "{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}" virtualenv: "{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}"
state: present state: present
become_user: "{{ analytics_api_user }}" become_user: "{{ analytics_api_user }}"
with_items: analytics_api_requirements with_items: "{{ analytics_api_requirements }}"
tags: tags:
- install - install
- install:app-requirements - install:app-requirements
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
- name: install antivirus system packages - name: install antivirus system packages
apt: pkg={{ item }} install_recommends=yes state=present apt: pkg={{ item }} install_recommends=yes state=present
with_items: antivirus_debian_pkgs with_items: "{{ antivirus_debian_pkgs }}"
- name: create antivirus scanner user - name: create antivirus scanner user
user: user:
...@@ -60,4 +60,4 @@ ...@@ -60,4 +60,4 @@
hour: "*" hour: "*"
minute: "0" minute: "0"
day: "*" day: "*"
with_items: ANTIVIRUS_BUCKETS with_items: "{{ ANTIVIRUS_BUCKETS }}"
...@@ -106,4 +106,4 @@ ...@@ -106,4 +106,4 @@
vagrant_home_dir.stat.exists == false and vagrant_home_dir.stat.exists == false and
ansible_distribution in common_debian_variants and ansible_distribution in common_debian_variants and
item.stat.exists item.stat.exists
with_items: motd_files_exist.results with_items: "{{ motd_files_exist.results }}"
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
- name: download browser debian packages from S3 - name: download browser debian packages from S3
get_url: dest="/tmp/{{ item.name }}" url="{{ item.url }}" get_url: dest="/tmp/{{ item.name }}" url="{{ item.url }}"
register: download_deb register: download_deb
with_items: browser_s3_deb_pkgs with_items: "{{ browser_s3_deb_pkgs }}"
- name: install browser debian packages - name: install browser debian packages
shell: gdebi -nq /tmp/{{ item.name }} shell: gdebi -nq /tmp/{{ item.name }}
when: download_deb.changed when: download_deb.changed
with_items: browser_s3_deb_pkgs with_items: "{{ browser_s3_deb_pkgs }}"
# Because the source location has been deprecated, we need to # Because the source location has been deprecated, we need to
# ensure it does not interfere with subsequent apt commands # ensure it does not interfere with subsequent apt commands
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
file: file:
path: "{{ cassandra_data_dir_prefix }}/{{ item }}" path: "{{ cassandra_data_dir_prefix }}/{{ item }}"
state: directory state: directory
with_items: cassandra_data_dirs with_items: "{{ cassandra_data_dirs }}"
- name: Mount ephemeral disks - name: Mount ephemeral disks
mount: mount:
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
path: "{{ cassandra_data_dir_prefix }}/{{ item }}" path: "{{ cassandra_data_dir_prefix }}/{{ item }}"
owner: "{{ cassandra_user }}" owner: "{{ cassandra_user }}"
group: "{{ cassandra_group }}" group: "{{ cassandra_group }}"
with_items: cassandra_data_dirs with_items: "{{ cassandra_data_dirs }}"
- name: Add the datastax repository apt-key - name: Add the datastax repository apt-key
apt_key: apt_key:
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
fail: fail:
msg: "Configuration Sources Checking (COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING) is enabled, you must define {{ item }}" msg: "Configuration Sources Checking (COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING) is enabled, you must define {{ item }}"
when: COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING and ({{ item }} is not defined or {{ item }} != True) when: COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING and ({{ item }} is not defined or {{ item }} != True)
with_items: COMMON_EXTRA_CONFIGURATION_SOURCES with_items: "{{ COMMON_EXTRA_CONFIGURATION_SOURCES }}"
tags: tags:
- "install" - "install"
- "install:configuration" - "install:configuration"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
args: args:
chdir: "{{ demo_edxapp_code_dir }}" chdir: "{{ demo_edxapp_code_dir }}"
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
with_items: demo_test_users with_items: "{{ demo_test_users }}"
when: demo_checkout.changed when: demo_checkout.changed
- name: create staff user - name: create staff user
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
shell: "{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws --service-variant lms cert_whitelist -a {{ item.email }} -c {{ demo_course_id }}" shell: "{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws --service-variant lms cert_whitelist -a {{ item.email }} -c {{ demo_course_id }}"
args: args:
chdir: "{{ demo_edxapp_code_dir }}" chdir: "{{ demo_edxapp_code_dir }}"
with_items: demo_test_users with_items: "{{ demo_test_users }}"
when: demo_checkout.changed when: demo_checkout.changed
- name: seed the forums for the demo course - name: seed the forums for the demo course
shell: "{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws seed_permissions_roles {{ demo_course_id }}" shell: "{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws seed_permissions_roles {{ demo_course_id }}"
args: args:
chdir: "{{ demo_edxapp_code_dir }}" chdir: "{{ demo_edxapp_code_dir }}"
with_items: demo_test_users with_items: "{{ demo_test_users }}"
when: demo_checkout.changed when: demo_checkout.changed
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
virtualenv: '{{ ecommerce_worker_home }}/venvs/{{ ecommerce_worker_service_name }}' virtualenv: '{{ ecommerce_worker_home }}/venvs/{{ ecommerce_worker_service_name }}'
state: present state: present
become_user: '{{ ecommerce_worker_user }}' become_user: '{{ ecommerce_worker_user }}'
with_items: ecommerce_worker_requirements with_items: "{{ ecommerce_worker_requirements }}"
- name: write out the supervisor wrapper - name: write out the supervisor wrapper
template: template:
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
state: present state: present
extra_args: "--exists-action w" extra_args: "--exists-action w"
become_user: "{{ edx_notes_api_user }}" become_user: "{{ edx_notes_api_user }}"
with_items: edx_notes_api_requirements with_items: "{{ edx_notes_api_requirements }}"
- name: Migrate - name: Migrate
shell: > shell: >
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
shell: /bin/bash shell: /bin/bash
groups: "{{ themes_group }}" groups: "{{ themes_group }}"
append: yes append: yes
with_items: theme_users with_items: "{{ theme_users }}"
when: theme_users is defined when: theme_users is defined
- name: update .bashrc to set umask value - name: update .bashrc to set umask value
......
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
extra_args: "--exists-action w {{ item.extra_args|default('') }}" extra_args: "--exists-action w {{ item.extra_args|default('') }}"
virtualenv: "{{ edxapp_venv_dir }}" virtualenv: "{{ edxapp_venv_dir }}"
state: present state: present
with_items: EDXAPP_EXTRA_REQUIREMENTS with_items: "{{ EDXAPP_EXTRA_REQUIREMENTS }}"
become_user: "{{ edxapp_user }}" become_user: "{{ edxapp_user }}"
tags: tags:
- install - install
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
--- ---
- name: install pip packages - name: install pip packages
pip: name={{ item }} state=present pip: name={{ item }} state=present
with_items: gh_mirror_pip_pkgs with_items: "{{ gh_mirror_pip_pkgs }}"
- name: install debian packages - name: install debian packages
apt: apt:
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
copy: copy:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ gh_mirror_app_dir }}/{{ item }}" dest: "{{ gh_mirror_app_dir }}/{{ item }}"
with_items: gh_mirror_app_files with_items: "{{ gh_mirror_app_files }}"
- name: creating cron job to update repos - name: creating cron job to update repos
cron: cron:
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
fail: fail:
msg: '{{ GIT_REPOS.PROTOCOL }} must be "https" or "ssh"' msg: '{{ GIT_REPOS.PROTOCOL }} must be "https" or "ssh"'
when: (item.PROTOCOL != "https") and (item.PROTOCOL != "ssh") and GIT_REPOS is defined when: (item.PROTOCOL != "https") and (item.PROTOCOL != "ssh") and GIT_REPOS is defined
with_items: GIT_REPOS with_items: "{{ GIT_REPOS }}"
no_log: true no_log: true
tags: tags:
- install - install
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
group: "{{ repo_group }}" group: "{{ repo_group }}"
mode: "0600" mode: "0600"
when: item.PROTOCOL == "ssh" and GIT_REPOS is defined when: item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items: GIT_REPOS with_items: "{{ GIT_REPOS }}"
no_log: true no_log: true
tags: tags:
- install - install
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
become_user: "{{ repo_owner }}" become_user: "{{ repo_owner }}"
register: code_checkout register: code_checkout
when: item.PROTOCOL == "ssh" and GIT_REPOS is defined when: item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items: GIT_REPOS with_items: "{{ GIT_REPOS }}"
no_log: true no_log: true
tags: tags:
- install - install
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
become_user: "{{ repo_owner }}" become_user: "{{ repo_owner }}"
register: code_checkout register: code_checkout
when: item.PROTOCOL == "https" and GIT_REPOS is defined when: item.PROTOCOL == "https" and GIT_REPOS is defined
with_items: GIT_REPOS with_items: "{{ GIT_REPOS }}"
no_log: true no_log: true
tags: tags:
- install - install
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
dest: "{{ git_home }}/.ssh/{{ item.REPO }}" dest: "{{ git_home }}/.ssh/{{ item.REPO }}"
state: absent state: absent
when: item.PROTOCOL == "ssh" and GIT_REPOS is defined when: item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items: GIT_REPOS with_items: "{{ GIT_REPOS }}"
no_log: true no_log: true
tags: tags:
- install - install
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- name: clone all course repos - name: clone all course repos
git_2_0_1: dest={{ GITRELOAD_REPODIR }}/{{ item.name }} repo={{ item.url }} version={{ item.commit }} git_2_0_1: dest={{ GITRELOAD_REPODIR }}/{{ item.name }} repo={{ item.url }} version={{ item.commit }}
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
with_items: GITRELOAD_REPOS with_items: "{{ GITRELOAD_REPOS }}"
- name: do import of courses - name: do import of courses
shell: "SERVICE_VARIANT=lms {{ edxapp_venv_bin }}/python manage.py lms --settings=aws git_add_course {{ item.url }} {{ GITRELOAD_REPODIR }}/{{ item.name }}" shell: "SERVICE_VARIANT=lms {{ edxapp_venv_bin }}/python manage.py lms --settings=aws git_add_course {{ item.url }} {{ GITRELOAD_REPODIR }}/{{ item.name }}"
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
executable: "/bin/bash" executable: "/bin/bash"
chdir: "{{ edxapp_code_dir }}" chdir: "{{ edxapp_code_dir }}"
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
with_items: GITRELOAD_REPOS with_items: "{{ GITRELOAD_REPOS }}"
- name: change ownership on repos for access by edxapp and www-data - name: change ownership on repos for access by edxapp and www-data
file: file:
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
- name: grab ssh host keys - name: grab ssh host keys
shell: ssh-keyscan {{ item }} shell: ssh-keyscan {{ item }}
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
with_items: GITRELOAD_HOSTS with_items: "{{ GITRELOAD_HOSTS }}"
register: gitreload_repo_host_keys register: gitreload_repo_host_keys
- name: add host keys if needed to known_hosts - name: add host keys if needed to known_hosts
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
dest: ~/.ssh/known_hosts dest: ~/.ssh/known_hosts
line: "{{ item.stdout }}" line: "{{ item.stdout }}"
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
with_items: gitreload_repo_host_keys.results with_items: "{{ gitreload_repo_host_keys.results }}"
- name: create a symlink for venv python - name: create a symlink for venv python
file: file:
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
# Ignoring error below so that we can move the data folder and have it be a link # Ignoring error below so that we can move the data folder and have it be a link
- name: all | create folders - name: all | create folders
file: path={{ item.path }} state=directory file: path={{ item.path }} state=directory
with_items: gluster_volumes with_items: "{{ gluster_volumes }}"
when: > when: >
"{{ ansible_default_ipv4.address }}" in "{{ gluster_peers|join(' ') }}" "{{ ansible_default_ipv4.address }}" in "{{ gluster_peers|join(' ') }}"
ignore_errors: yes ignore_errors: yes
...@@ -32,33 +32,33 @@ ...@@ -32,33 +32,33 @@
- name: primary | create peers - name: primary | create peers
command: gluster peer probe {{ item }} command: gluster peer probe {{ item }}
with_items: gluster_peers with_items: "{{ gluster_peers }}"
when: ansible_default_ipv4.address == gluster_primary_ip when: ansible_default_ipv4.address == gluster_primary_ip
tags: gluster tags: gluster
- name: primary | create volumes - name: primary | create volumes
command: gluster volume create {{ item.name }} replica {{ item.replicas }} transport tcp {% for server in gluster_peers %}{{ server }}:{{ item.path }} {% endfor %} command: gluster volume create {{ item.name }} replica {{ item.replicas }} transport tcp {% for server in gluster_peers %}{{ server }}:{{ item.path }} {% endfor %}
with_items: gluster_volumes with_items: "{{ gluster_volumes }}"
when: ansible_default_ipv4.address == gluster_primary_ip when: ansible_default_ipv4.address == gluster_primary_ip
ignore_errors: yes # There should be better error checking here ignore_errors: yes # There should be better error checking here
tags: gluster tags: gluster
- name: primary | start volumes - name: primary | start volumes
command: gluster volume start {{ item.name }} command: gluster volume start {{ item.name }}
with_items: gluster_volumes with_items: "{{ gluster_volumes }}"
when: ansible_default_ipv4.address == gluster_primary_ip when: ansible_default_ipv4.address == gluster_primary_ip
ignore_errors: yes # There should be better error checking here ignore_errors: yes # There should be better error checking here
tags: gluster tags: gluster
- name: primary | set security - name: primary | set security
command: gluster volume set {{ item.name }} auth.allow {{ item.security }} command: gluster volume set {{ item.name }} auth.allow {{ item.security }}
with_items: gluster_volumes with_items: "{{ gluster_volumes }}"
when: ansible_default_ipv4.address == gluster_primary_ip when: ansible_default_ipv4.address == gluster_primary_ip
tags: gluster tags: gluster
- name: primary | set performance cache - name: primary | set performance cache
command: gluster volume set {{ item.name }} performance.cache-size {{ item.cache_size }} command: gluster volume set {{ item.name }} performance.cache-size {{ item.cache_size }}
with_items: gluster_volumes with_items: "{{ gluster_volumes }}"
when: ansible_default_ipv4.address == gluster_primary_ip when: ansible_default_ipv4.address == gluster_primary_ip
tags: gluster tags: gluster
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
fstype: glusterfs fstype: glusterfs
state: mounted state: mounted
opts: defaults,_netdev opts: defaults,_netdev
with_items: gluster_volumes with_items: "{{ gluster_volumes }}"
tags: gluster tags: gluster
# This required due to an annoying bug in Ubuntu and gluster where it tries to mount the system # This required due to an annoying bug in Ubuntu and gluster where it tries to mount the system
......
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
state: present state: present
update_cache: true update_cache: true
cache_valid_time: 3600 cache_valid_time: 3600
with_items: GO_SERVER_BACKUP_APT_PKGS with_items: "{{ GO_SERVER_BACKUP_APT_PKGS }}"
- name: install required python packages - name: install required python packages
pip: pip:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: GO_SERVER_BACKUP_PIP_PKGS with_items: "{{ GO_SERVER_BACKUP_PIP_PKGS }}"
- name: create the temp directory - name: create the temp directory
file: file:
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
state: present state: present
update_cache: true update_cache: true
cache_valid_time: 3600 cache_valid_time: 3600
with_items: GO_SERVER_APT_PKGS with_items: "{{ GO_SERVER_APT_PKGS }}"
- name: create go-server plugin directory - name: create go-server plugin directory
file: file:
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
apt: apt:
pkg: "{{ item }}" pkg: "{{ item }}"
state: present state: present
with_items: hadoop_common_debian_pkgs with_items: "{{ hadoop_common_debian_pkgs }}"
- name: ensure group exists - name: ensure group exists
group: group:
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
- install - install
- install:app-requirements - install:app-requirements
become_user: "{{ harstorage_user }}" become_user: "{{ harstorage_user }}"
with_items: harstorage_python_pkgs with_items: "{{ harstorage_python_pkgs }}"
- name: create directories - name: create directories
file: file:
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
state: present state: present
extra_args: "--exists-action w" extra_args: "--exists-action w"
become_user: "{{ insights_user }}" become_user: "{{ insights_user }}"
with_items: insights_requirements with_items: "{{ insights_requirements }}"
tags: tags:
- install - install
- install:app-requirements - install:app-requirements
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
repo: "{{ item }}" repo: "{{ item }}"
state: "present" state: "present"
update_cache: "yes" update_cache: "yes"
with_items: jenkins_admin_debian_repos with_items: "{{ jenkins_admin_debian_repos }}"
- name: create the scripts directory - name: create the scripts directory
file: file:
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- name: install jenkins analytics extra system packages - name: install jenkins analytics extra system packages
apt: apt:
pkg={{ item }} state=present update_cache=yes pkg={{ item }} state=present update_cache=yes
with_items: JENKINS_ANALYTICS_EXTRA_PKGS with_items: "{{ JENKINS_ANALYTICS_EXTRA_PKGS }}"
tags: tags:
- jenkins - jenkins
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
state: "present" state: "present"
update_cache: true update_cache: true
cache_valid_time: 3600 cache_valid_time: 3600
with_items: locust_debian_pkgs with_items: "{{ locust_debian_pkgs }}"
- name: Install application requirements - name: Install application requirements
pip: pip:
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
- name: Install python requirements - name: Install python requirements
pip: name={{ item }} state=present pip: name={{ item }} state=present
with_items: logstash_python_requirements with_items: "{{ logstash_python_requirements }}"
- name: Checkout logstash rotation scripts - name: Checkout logstash rotation scripts
git: repo={{ logstash_scripts_repo }} dest={{ logstash_app_dir }}/share/logstash-elasticsearch-scripts git: repo={{ logstash_scripts_repo }} dest={{ logstash_app_dir }}/share/logstash-elasticsearch-scripts
......
...@@ -54,4 +54,4 @@ ...@@ -54,4 +54,4 @@
# scripts to prevent haproxy checks exceeding `max_connect_errors`. # scripts to prevent haproxy checks exceeding `max_connect_errors`.
- name: create haproxy monitor user - name: create haproxy monitor user
command: "mysql -e \"INSERT INTO mysql.user (Host,User) values ('{{ item }}','{{ MARIADB_HAPROXY_USER }}'); FLUSH PRIVILEGES;\"" command: "mysql -e \"INSERT INTO mysql.user (Host,User) values ('{{ item }}','{{ MARIADB_HAPROXY_USER }}'); FLUSH PRIVILEGES;\""
with_items: MARIADB_HAPROXY_HOSTS with_items: "{{ MARIADB_HAPROXY_HOSTS }}"
...@@ -23,10 +23,11 @@ ...@@ -23,10 +23,11 @@
- name: Install pre-req debian packages - name: Install pre-req debian packages
apt: name={{ item }} state=present apt: name={{ item }} state=present
with_items: mariadb_debian_pkgs with_items: "{{ mariadb_debian_pkgs }}"
- name: Add mariadb apt key - name: Add mariadb apt key
apt_key: url="{{ COMMON_UBUNTU_APT_KEYSERVER }}{{ MARIADB_APT_KEY_ID }}" apt_key:
url: "{{ COMMON_UBUNTU_APT_KEYSERVER }}{{ MARIADB_APT_KEY_ID }}"
- name: add the mariadb repo to the sources list - name: add the mariadb repo to the sources list
apt_repository: apt_repository:
...@@ -35,12 +36,12 @@ ...@@ -35,12 +36,12 @@
- name: install mariadb solo packages - name: install mariadb solo packages
apt: name={{ item }} update_cache=yes apt: name={{ item }} update_cache=yes
with_items: mariadb_solo_packages with_items: "{{ mariadb_solo_packages }}"
when: not MARIADB_CLUSTERED|bool when: not MARIADB_CLUSTERED|bool
- name: install mariadb cluster packages - name: install mariadb cluster packages
apt: name={{ item }} update_cache=yes apt: name={{ item }} update_cache=yes
with_items: mariadb_cluster_packages with_items: "{{ mariadb_cluster_packages }}"
when: MARIADB_CLUSTERED|bool when: MARIADB_CLUSTERED|bool
- name: remove bind-address - name: remove bind-address
...@@ -61,7 +62,7 @@ ...@@ -61,7 +62,7 @@
db: "{{ item }}" db: "{{ item }}"
state: present state: present
encoding: utf8 encoding: utf8
with_items: MARIADB_DATABASES with_items: "{{ "{{ MARIADB_DATABASES }}" }}"
when: MARIADB_CREATE_DBS|bool when: MARIADB_CREATE_DBS|bool
- name: create all analytics dbs - name: create all analytics dbs
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
db: "{{ item }}" db: "{{ item }}"
state: present state: present
encoding: utf8 encoding: utf8
with_items: MARIADB_ANALYTICS_DATABASES with_items: "{{ MARIADB_ANALYTICS_DATABASES }}"
when: MARIADB_CREATE_DBS|bool and ANALYTICS_API_CONFIG is defined when: MARIADB_CREATE_DBS|bool and ANALYTICS_API_CONFIG is defined
- name: create all users/privs - name: create all users/privs
...@@ -79,7 +80,7 @@ ...@@ -79,7 +80,7 @@
priv: "{{ item.priv }}" priv: "{{ item.priv }}"
host: "{{ item.host }}" host: "{{ item.host }}"
append_privs: yes append_privs: yes
with_items: MARIADB_USERS with_items: "{{ MARIADB_USERS }}"
when: MARIADB_CREATE_DBS|bool when: MARIADB_CREATE_DBS|bool
- name: create all analytics users/privs - name: create all analytics users/privs
...@@ -89,5 +90,5 @@ ...@@ -89,5 +90,5 @@
priv: "{{ item.priv }}" priv: "{{ item.priv }}"
host: "{{ item.host }}" host: "{{ item.host }}"
append_privs: yes append_privs: yes
with_items: MARIADB_ANALYTICS_USERS with_items: "{{ MARIADB_ANALYTICS_USERS }}"
when: MARIADB_CREATE_DBS|bool and ANALYTICS_API_CONFIG is defined when: MARIADB_CREATE_DBS|bool and ANALYTICS_API_CONFIG is defined
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
install_recommends: yes install_recommends: yes
force: yes force: yes
update_cache: yes update_cache: yes
with_items: mongodb_debian_pkgs with_items: "{{ mongodb_debian_pkgs }}"
tags: tags:
- install - install
- install:app-requirements - install:app-requirements
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
roles: "{{ item.roles }}" roles: "{{ item.roles }}"
state: present state: present
replica_set: "{{ MONGO_REPL_SET }}" replica_set: "{{ MONGO_REPL_SET }}"
with_items: MONGO_USERS with_items: "{{ MONGO_USERS }}"
run_once: true run_once: true
when: MONGO_CLUSTERED when: MONGO_CLUSTERED
tags: tags:
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
password: "{{ item.password }}" password: "{{ item.password }}"
roles: "{{ item.roles }}" roles: "{{ item.roles }}"
state: present state: present
with_items: MONGO_USERS with_items: "{{ MONGO_USERS }}"
when: not MONGO_CLUSTERED when: not MONGO_CLUSTERED
tags: tags:
- "manage" - "manage"
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
url: "{{ base_url }}/{{ item.dir }}/{{ item.agent }}_{{ item.version }}_{{ pkg_arch }}.{{ pkg_format }}" url: "{{ base_url }}/{{ item.dir }}/{{ item.agent }}_{{ item.version }}_{{ pkg_arch }}.{{ pkg_format }}"
dest: "/tmp/{{ item.agent }}-{{ item.version }}.{{ pkg_format }}" dest: "/tmp/{{ item.agent }}-{{ item.version }}.{{ pkg_format }}"
register: download_mms_deb register: download_mms_deb
with_items: with_items: "{{ agents }}"
agents
- name: install mongo mms agent - name: install mongo mms agent
apt: apt:
...@@ -32,12 +31,10 @@ ...@@ -32,12 +31,10 @@
regexp: "^mmsApiKey=" regexp: "^mmsApiKey="
line: "mmsApiKey={{ MMSAPIKEY }}" line: "mmsApiKey={{ MMSAPIKEY }}"
notify: restart mms notify: restart mms
with_items: with_items: "{{ agents }}"
agents
- name: start mms service - name: start mms service
service: service:
name: "{{ item.agent }}" name: "{{ item.agent }}"
state: started state: started
with_items: with_items: "{{ agents }}"
agents
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
fstype: "{{ (ansible_mounts | selectattr('device', 'equalto', item.device) | first | default({'fstype': None})).fstype }}" fstype: "{{ (ansible_mounts | selectattr('device', 'equalto', item.device) | first | default({'fstype': None})).fstype }}"
state: unmounted state: unmounted
when: "{{ UNMOUNT_DISKS and (ansible_mounts | selectattr('device', 'equalto', item.device) | first | default({'fstype': None})).fstype != item.fstype }}" when: "{{ UNMOUNT_DISKS and (ansible_mounts | selectattr('device', 'equalto', item.device) | first | default({'fstype': None})).fstype != item.fstype }}"
with_items: volumes with_items: "{{ volumes }}"
# Noop & reports "ok" if fstype is correct # Noop & reports "ok" if fstype is correct
# Errors if fstype is wrong and disk is mounted (hence above task) # Errors if fstype is wrong and disk is mounted (hence above task)
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
fstype: "{{ item.fstype }}" fstype: "{{ item.fstype }}"
# Necessary because AWS gives some ephemeral disks the wrong fstype by default # Necessary because AWS gives some ephemeral disks the wrong fstype by default
force: true force: true
with_items: volumes with_items: "{{ volumes }}"
# This can fail if one volume is mounted on a child directory as another volume # This can fail if one volume is mounted on a child directory as another volume
# and it attempts to unmount the parent first. This is generally fixable by rerunning. # and it attempts to unmount the parent first. This is generally fixable by rerunning.
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
UNMOUNT_DISKS and UNMOUNT_DISKS and
volumes | selectattr('device', 'equalto', item.device) | list | length != 0 and volumes | selectattr('device', 'equalto', item.device) | list | length != 0 and
(volumes | selectattr('device', 'equalto', item.device) | first).mount != item.mount (volumes | selectattr('device', 'equalto', item.device) | first).mount != item.mount
with_items: ansible_mounts with_items: "{{ ansible_mounts }}"
# If there are disks we want to be unmounting, but we can't because UNMOUNT_DISKS is false # If there are disks we want to be unmounting, but we can't because UNMOUNT_DISKS is false
# that is an errorable condition, since it can easily allow us to double mount a disk. # that is an errorable condition, since it can easily allow us to double mount a disk.
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
not UNMOUNT_DISKS and not UNMOUNT_DISKS and
volumes | selectattr('device', 'equalto', item.device) | list | length != 0 and volumes | selectattr('device', 'equalto', item.device) | list | length != 0 and
(volumes | selectattr('device', 'equalto', item.device) | first).mount != item.mount (volumes | selectattr('device', 'equalto', item.device) | first).mount != item.mount
with_items: ansible_mounts with_items: "{{ ansible_mounts }}"
- name: Mount disks - name: Mount disks
mount: mount:
...@@ -72,4 +72,4 @@ ...@@ -72,4 +72,4 @@
state: mounted state: mounted
fstype: "{{ item.fstype }}" fstype: "{{ item.fstype }}"
opts: "{{ item.options }}" opts: "{{ item.options }}"
with_items: volumes with_items: "{{ volumes }}"
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
name: "{{ item }}" name: "{{ item }}"
install_recommends: yes install_recommends: yes
state: present state: present
with_items: mysql_debian_pkgs with_items: "{{ mysql_debian_pkgs }}"
- name: Start mysql - name: Start mysql
service: service:
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- name: create the nltk data directory and subdirectories - name: create the nltk data directory and subdirectories
file: path={{ NLTK_DATA_DIR }}/{{ item.path|dirname }} state=directory file: path={{ NLTK_DATA_DIR }}/{{ item.path|dirname }} state=directory
with_items: NLTK_DATA with_items: "{{ NLTK_DATA }}"
tags: tags:
- deploy - deploy
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
get_url: get_url:
dest: "{{ NLTK_DATA_DIR }}/{{ item.url|basename }}" dest: "{{ NLTK_DATA_DIR }}/{{ item.url|basename }}"
url: "{{ item.url }}" url: "{{ item.url }}"
with_items: NLTK_DATA with_items: "{{ NLTK_DATA }}"
register: nltk_download register: nltk_download
tags: tags:
- deploy - deploy
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
shell: "unzip {{ NLTK_DATA_DIR }}/{{ item.url|basename }}" shell: "unzip {{ NLTK_DATA_DIR }}/{{ item.url|basename }}"
args: args:
chdir: "{{ NLTK_DATA_DIR }}/{{ item.path|dirname }}" chdir: "{{ NLTK_DATA_DIR }}/{{ item.path|dirname }}"
with_items: NLTK_DATA with_items: "{{ NLTK_DATA }}"
when: nltk_download|changed when: nltk_download|changed
tags: tags:
- deploy - deploy
...@@ -35,5 +35,5 @@ ...@@ -35,5 +35,5 @@
--logout_uri {{ item.logout_uri | default("") }} --logout_uri {{ item.logout_uri | default("") }}
become_user: "{{ edxapp_user }}" become_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
with_items: oauth_client_setup_oauth2_clients with_items: "{{ oauth_client_setup_oauth2_clients }}"
when: item.name != 'None' when: item.name != 'None'
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
- name: install build depends - name: install build depends
apt: pkg={{ ",".join(rbenv_debian_pkgs) }} update_cache=yes state=present install_recommends=no apt: pkg={{ ",".join(rbenv_debian_pkgs) }} update_cache=yes state=present install_recommends=no
with_items: rbenv_debian_pkgs with_items: "{{ rbenv_debian_pkgs }}"
tags: tags:
- install - install
- install:base - install:base
......
...@@ -29,13 +29,13 @@ ...@@ -29,13 +29,13 @@
# file: # file:
# path={{ item.mount_point }} owner={{ item.owner }} # path={{ item.mount_point }} owner={{ item.owner }}
# group={{ item.group }} mode={{ item.mode }} state="directory" # group={{ item.group }} mode={{ item.mode }} state="directory"
# with_items: my_role_s3fs_mounts # with_items: "{{ my_role_s3fs_mounts }}"
# #
# - name: mount s3 buckets # - name: mount s3 buckets
# mount: # mount:
# name={{ item.mount_point }} src={{ item.bucket }} fstype=fuse.s3fs # name={{ item.mount_point }} src={{ item.bucket }} fstype=fuse.s3fs
# opts=use_cache=/tmp,iam_role={{ task_iam_role }},allow_other state=mounted # opts=use_cache=/tmp,iam_role={{ task_iam_role }},allow_other state=mounted
# with_items: myrole_s3fs_mounts # with_items: "{{ myrole_s3fs_mounts }}"
# #
# Example play: # Example play:
# #
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
fail: fail:
msg: Please define either "source" or "sourcetype", not both or neither msg: Please define either "source" or "sourcetype", not both or neither
when: ('source' in item and 'sourcetype' in item) or ('source' not in item and 'sourcetype' not in item) when: ('source' in item and 'sourcetype' in item) or ('source' not in item and 'sourcetype' not in item)
with_items: SPLUNK_FIELD_EXTRACTIONS with_items: "{{ SPLUNK_FIELD_EXTRACTIONS }}"
- name: Make sure necessary dirs exist - name: Make sure necessary dirs exist
file: file:
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
owner: "{{ splunk_user }}" owner: "{{ splunk_user }}"
group: "{{ splunk_user }}" group: "{{ splunk_user }}"
mode: 0700 mode: 0700
with_items: SPLUNK_DASHBOARDS with_items: "{{ SPLUNK_DASHBOARDS }}"
tags: tags:
- install - install
- install:configuration - install:configuration
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
group: splunk group: splunk
mode: "0400" mode: "0400"
when: "{{ item.ssl_cert is defined }}" when: "{{ item.ssl_cert is defined }}"
with_items: SPLUNKFORWARDER_SERVERS with_items: "{{ SPLUNKFORWARDER_SERVERS }}"
- name: Write root CA to disk - name: Write root CA to disk
copy: copy:
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
group: splunk group: splunk
mode: "0400" mode: "0400"
when: "{{ item.ssl_cert is defined }}" when: "{{ item.ssl_cert is defined }}"
with_items: SPLUNKFORWARDER_SERVERS with_items: "{{ SPLUNKFORWARDER_SERVERS }}"
- name: Create inputs and outputs configuration - name: Create inputs and outputs configuration
template: template:
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
shell: "{{ demo_edxapp_venv_bin }}/python /edx/bin/manage.edxapp lms git_add_course --settings=aws \"{{ item.github_url }}\"" shell: "{{ demo_edxapp_venv_bin }}/python /edx/bin/manage.edxapp lms git_add_course --settings=aws \"{{ item.github_url }}\""
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
when: item.install == True when: item.install == True
with_items: TESTCOURSES_EXPORTS with_items: "{{ TESTCOURSES_EXPORTS }}"
- name: enroll test users in the testcourses - name: enroll test users in the testcourses
shell: "{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws --service-variant lms enroll_user_in_course -e {{ item[0].email }} -c {{ item[1].course_id }}" shell: "{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws --service-variant lms enroll_user_in_course -e {{ item[0].email }} -c {{ item[1].course_id }}"
...@@ -12,5 +12,5 @@ ...@@ -12,5 +12,5 @@
become_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
when: item[1].install == True when: item[1].install == True
with_nested: with_nested:
- demo_test_users - "{{ demo_test_users }}"
- TESTCOURSES_EXPORTS - "{{ TESTCOURSES_EXPORTS }}"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
owner: "{{ jenkins_user }}" owner: "{{ jenkins_user }}"
group: "{{ jenkins_group }}" group: "{{ jenkins_group }}"
mode: 0644 mode: 0644
with_items: hpi_files.stdout_lines with_items: "{{ hpi_files.stdout_lines }}"
when: hpi_files when: hpi_files
notify: notify:
- restart Jenkins - restart Jenkins
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
owner: "{{ jenkins_user }}" owner: "{{ jenkins_user }}"
group: "{{ jenkins_group }}" group: "{{ jenkins_group }}"
mode: 0644 mode: 0644
with_items: jpi_files.stdout_lines with_items: "{{ jpi_files.stdout_lines }}"
when: jpi_files when: jpi_files
notify: notify:
- restart Jenkins - restart Jenkins
......
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