Skip to content

Commit

Permalink
fixes to resolve lots of lint issues, there's still more but no alter…
Browse files Browse the repository at this point in the history
…natives to the task performed yet
  • Loading branch information
Eric Anderson committed Jun 4, 2019
1 parent d9d038b commit 5c92822
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 55 deletions.
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ con_mounts_default:
- "{{ con_disk_path }}:/vol/"
- "{{ (con_metrics_disk_path == None)|ternary('', con_metrics_disk_path ~ ':/vol_metrics/') }}"
- "{{ (con_logs_disk_path == None)|ternary('', con_logs_disk_path ~ ':/vol_logs/') }}"
con_mounts_all: "{{ con_mounts_extras + con_mounts_default}}"
con_mounts_all: "{{ con_mounts_extras + con_mounts_default }}"
con_mounts_string: "{% for mount_var in con_mounts_all|reject('match', '^$') %} -v {{ mount_var }}{% endfor %}"

# Environment variables which are sent to the docker container, these are used in the service templates.
con_env_variables_extras: []
con_env_variables_default:
- "CONTAINER_NAME=avicontroller"
- "MANAGEMENT_IP={{ con_controller_ip|string}}"
- "MANAGEMENT_IP={{ con_controller_ip|string }}"
- "NUM_CPU={{ con_cores }}"
- "NUM_MEMG={{ con_memory_gb }}"
- "DISK_GB={{ con_disk_gb }}"
Expand Down
9 changes: 7 additions & 2 deletions tasks/docker/con_requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@

- name: Avi Controller | Requirements | Set max_cores and memory limits of environment
set_fact:
con_max_cores: "{{ ansible_processor_cores * ansible_processor_count * ansible_processor_threads_per_core}}"
con_max_cores: "{{ ansible_processor_cores * ansible_processor_count * ansible_processor_threads_per_core }}"
con_ansible_memtotal_gb: "{{ ansible_memtotal_mb // 1024 }}"

- name: Avi Controller | Requirements | Get Ansible processor info
debug: msg="con_max_cores {{con_max_cores}} ansible processor cores {{ ansible_processor_cores }} count {{ansible_processor_count}} threads {{ansible_processor_threads_per_core}}"
debug:
msg: >-
con_max_cores {{ con_max_cores }}
ansible processor cores {{ ansible_processor_cores }}
count {{ ansible_processor_count }}
threads {{ ansible_processor_threads_per_core }}
when: not con_skip_requirements

- name: Avi Controller | Requirements | Validate Parameters
Expand Down
4 changes: 2 additions & 2 deletions tasks/docker/custom_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
- block:
- name: Avi Controller | Docker | Log into the custom docker repository
shell: "docker login -u {{ con_docker_repo_user }} -p {{ con_docker_repo_password}} {{ con_docker_repo }}"
shell: "docker login -u {{ con_docker_repo_user }} -p {{ con_docker_repo_password }} {{ con_docker_repo }}"
register: con_docker_repo_login
when:
- con_docker_repo_user != None
Expand All @@ -14,4 +14,4 @@
register: con_load_docker_repo
changed_when: "'Status: Image is up to date' not in con_load_docker_repo.stdout"
notify: Avi Controller | Services | Restart the avicontroller service
when: con_docker_match.stdout == "" or con_version == "latest"
when: not con_docker_match.stdout or con_version == "latest"
2 changes: 1 addition & 1 deletion tasks/docker/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

- name: Avi Controller | Set service facts for deploy
set_fact:
con_new_service: "{{ con_version|version_compare('19.1.1', '>=') }}"
con_new_service: "{{ con_version is version_compare('19.1.1', '>=') }}"

- name: Avi Controller | Docker | Cleanup
include: services/cleanup.yml
Expand Down
3 changes: 2 additions & 1 deletion tasks/docker/package_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
changed_when: false
register: con_load_docker_image

- set_fact:
- name: Set con_version and con_image facts
set_fact:
con_version: "{{ con_load_docker_image.stdout }}"
con_image: "avinetworks/controller:{{ con_load_docker_image.stdout }}"
2 changes: 1 addition & 1 deletion tasks/docker/services/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
- name: Avi Controller | Docker | Cleanup | Remove non-matched controller images.
shell: "docker rmi -f {{ con_non_matched_images.stdout_lines|join(' ') }}"
changed_when: false
when: con_non_matched_images.stdout != ""
when: con_non_matched_images.stdout
5 changes: 0 additions & 5 deletions tasks/docker/services/initd/check.yml

This file was deleted.

40 changes: 0 additions & 40 deletions tasks/docker/services/initd/install.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tasks/docker/services/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

- name: Avi Controller | Services | {{ ansible_service_mgr }} | Start the service since it's not running |
service: name=avicontroller enabled=yes state=started
when: con_desired_running.stdout == ""
when: not con_desired_running.stdout

0 comments on commit 5c92822

Please sign in to comment.