Skip to content

Commit

Permalink
Using ansible from non-local, replace apt module with commands cause …
Browse files Browse the repository at this point in the history
  • Loading branch information
sshaufi committed Mar 30, 2024
1 parent e5f8a32 commit 14b6b4c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ansible-playbook/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[cloud]
cloud.ss.fish ansible_user=ansible
20 changes: 20 additions & 0 deletions ansible-playbook/update_upgrade_cloud.yml
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


0 comments on commit 14b6b4c

Please sign in to comment.