Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and *use* the ansible.cfg file #584

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

codenrhoden
Copy link
Contributor

What this PR does / why we need it:
The ansible.cfg file that is present in images/capi/ansible is not used
in any way because the Ansible commands won't pick it up in that
location. Since Ansible is run with a PWD of images/capi, put it there
instead.

Additionally, the .cfg file mistakenly had 'default' instead of
'defaults', meaning that all entries were being ignored. We no longer
need to specify a search path for filter plugins since we haven't used
any in a while, and the setting for retry files is already the default
in Ansible.

Which issue(s) this PR fixes (optional, in fixes #(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Additional context
This makes what is being sought in #531 a lot easier (I tested it, it works, but wanted to leave that PR separate).

/hold

With this change in place, SSH Pipeline will be used. This is a change that can significantly speed up builds. I've got the /hold in place because we at least need to make sure that every OS we currently build works with this change. If any OS has requiretty set by default in /etc/sudoers, it won't work. This is becoming less common, but I have no idea who sets it and who doesn't at this point.

/assign @kkeshavamurthy @detiber @CecileRobertMichon
if anyone does get a chance to take this for a spin, mind putting in a note what OS/provider combintation you tried to make sure the SSH pipelining worked?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 8, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: codenrhoden

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2021
@codenrhoden
Copy link
Contributor Author

I'm also fairly confident this doesn't affect Windows, since the issue is about TTY and sudo....

@codenrhoden
Copy link
Contributor Author

Both CentOS and AL2 on Amazon failed with:

    centos-7: fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /tmp/.ansible/ `\"&& mkdir \"` echo /tmp/.ansible/ansible-tmp-1617918862.6195111-29036-271485260635057 `\" && echo ansible-tmp-1617918862.6195111-29036-271485260635057=\"` echo /tmp/.ansible/ansible-tmp-1617918862.6195111-29036-271485260635057 `\" ), exited with result 1", "unreachable": true}

This is from the the remote_tmp = /tmp/.ansible/ line in the config. The default is ~/.ansible/tmp, and since this config file was not being used before, I see no reason to change it. I'm going to remove that line.

@codenrhoden
Copy link
Contributor Author

Wow, this opened a can of worms on my end. Starting to piece together all effects that are happening, and i think this will turn into a meaningiful cleanup. But it was more impactful than I suspected. Stay tuned.

The ansible.cfg file that is present in images/capi/ansible is not used
in any way because the Ansible commands won't pick it up in that
location. Since Ansible is run with a PWD of images/capi, put it there
instead.

Additionally, the .cfg file mistakenly had 'default' instead of
'defaults', meaning that all entries were being ignored. We no longer
need to specify a search path for filter plugins since we haven't used
any in a while, and the setting for retry files is already the default
in Ansible.
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 12, 2021
@codenrhoden
Copy link
Contributor Author

After playing with this for a bit, I figured out that enabling SSH pipelining is likely to take more work. So, in the interest of time, this just places the ansible.cfg file in the correct place and maintains all the settings that we were already running. So this does not introduce any change other than having the ansible.cfg file be read, which will make things like #531 a lot easier.

/hold cancel
/assign @kkeshavamurthy

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 12, 2021
@kkeshavamurthy
Copy link
Member

Thanks for fixing this @codenrhoden .
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 12, 2021
@codenrhoden
Copy link
Contributor Author

/test pull-azure-vhds

@k8s-ci-robot k8s-ci-robot merged commit 3e271f5 into kubernetes-sigs:master Apr 12, 2021
@codenrhoden codenrhoden deleted the ansible-cfg branch April 12, 2021 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants