Skip to content

Ansible fixes#415

Merged
arianvp merged 4 commits intodevelopfrom
ansible_fixes
Feb 11, 2021
Merged

Ansible fixes#415
arianvp merged 4 commits intodevelopfrom
ansible_fixes

Conversation

@jmatsushita
Copy link
Copy Markdown
Contributor

The with_dict fix is to prevent this from happening:

TASK [Annotate nodes] ************************************************************************************************************************
task path: /Users/jmatsushita/dev/wire-server-deploy/ansible/kubernetes.yml:11
fatal: [ci-dev-kubenode01]: FAILED! => {"msg": "with_dict expects a dict"}
fatal: [ci-dev-kubenode02]: FAILED! => {"msg": "with_dict expects a dict"}
fatal: [ci-dev-kubenode03]: FAILED! => {"msg": "with_dict expects a dict"}

The host: localhost replacement is to prevent this from happening:

TASK [Get all SRV recoreds] ******************************************************************************************************************
task path: /Users/jmatsushita/dev/wire-server-deploy/ansible/provision-sft.yml:32
fatal: [localhost]: FAILED! => {"changed": false, "msg": "boto required for this module"}

@jmatsushita jmatsushita requested a review from arianvp February 4, 2021 10:06
@jmatsushita jmatsushita marked this pull request as draft February 4, 2021 10:37
command: "kubectl annotate node --overwrite {{ inventory_hostname }} {{ item.key }}={{ item.value }}"
when: node_annotations is defined
with_dict: node_annotations
with_dict: node_annotations | default({})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with_dict: node_annotations | default({})
with_dict: "{{ node_annotations }}"

As in 5326661

Which I forgot to cherry-pick to develop

@jmatsushita jmatsushita marked this pull request as ready for review February 8, 2021 09:44
Copy link
Copy Markdown
Contributor

@arianvp arianvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arianvp arianvp merged commit 6b11a86 into develop Feb 11, 2021
@arianvp arianvp deleted the ansible_fixes branch February 11, 2021 08:19
@lucendio
Copy link
Copy Markdown
Contributor

About the localhost change: when Ansible throws boto required for this module, to me, sth seems to be off with the dependency mgmt (or visibility) here. The fakehost approach looks bit confusing I think, because this:

connection: local
vars:
  ansible_python_interpreter: "{{ ansible_playbook_python }}"

looks identical to what Ansible already does with hosts: localhost (second block), no?

lucendio added a commit that referenced this pull request Mar 31, 2021
at the moment CD skips fakehost plays, because it's not in the inventory;
defining some stub is not a nice solution, if the default (implicit)
works just fine. I guess we will find out shortly.

* this might only work properly with Nix when using Ansible >= v2.9
  but that is just a guess atm. We may need to go back to Ansible 2.7
  here
* partially reverting #415; current guess is that the error "boto
  required for this module" mentioned in the PR came form running
  it locally
lucendio added a commit that referenced this pull request Mar 31, 2021
at the moment CD skips fakehost plays, because it's not in the inventory;
defining some stub is not a nice solution, if the default (implicit)
works just fine. I guess we will find out shortly.

* this might only work properly with Nix when using Ansible >= v2.9
  but that is just a guess atm. We may need to go back to Ansible 2.7
  here
* partially reverting #415; current guess is that the error "boto
  required for this module" mentioned in the PR came form running
  it locally
arianvp pushed a commit that referenced this pull request Apr 16, 2021
at the moment CD skips fakehost plays, because it's not in the inventory;
defining some stub is not a nice solution, if the default (implicit)
works just fine. I guess we will find out shortly.

* this might only work properly with Nix when using Ansible >= v2.9
  but that is just a guess atm. We may need to go back to Ansible 2.7
  here
* partially reverting #415; current guess is that the error "boto
  required for this module" mentioned in the PR came form running
  it locally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants