-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using ansible from non-local, replace apt module with commands cause …
…of issues ansible/ansible#51663
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[cloud] | ||
cloud.ss.fish ansible_user=ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Update and upgrade cloud server | ||
hosts: cloud | ||
become: yes | ||
become_user: ansible | ||
become_method: sudo | ||
vars: | ||
ansible_become_flags: '-H' | ||
tasks: | ||
# Not using the apt moudle because of issue https://github.com/ansible/ansible/issues/51663 | ||
- name: Upgrade all package | ||
shell: "/usr/bin/sudo /usr/bin/apt update && /usr/bin/sudo /usr/bin/apt full-upgrade --auto-remove" | ||
become: true | ||
register: apt_output | ||
|
||
- name: Display apt update and full-upgrade stdout | ||
debug: | ||
var: apt_output.stdout_lines | ||
|
||
|