-
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.
add topgrade w/ it's configuration and update doc
- Loading branch information
1 parent
0887250
commit cd1846f
Showing
5 changed files
with
61 additions
and
2 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
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
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,50 @@ | ||
--- | ||
- name: Install Topgrade | ||
become: true | ||
get_url: | ||
url: "https://github.com/topgrade-rs/topgrade/releases/download/v{{ topgrade_version }}/topgrade-v{{ topgrade_version }}-x86_64-unknown-linux-gnu.tar.gz" | ||
dest: "/usr/local/bin/topgrade" | ||
mode: "0755" | ||
|
||
- name: Make Topgrade executable | ||
become: true | ||
command: chmod +x /usr/local/bin/topgrade | ||
|
||
- name: Check if .profile file exist | ||
become: true | ||
stat: | ||
path: "{{ home }}/.profile" | ||
register: profile_stat | ||
|
||
- name: Create .profile file if it doesn't exist | ||
become: true | ||
file: | ||
path: "{{ home }}/.profile" | ||
state: touch | ||
when: not profile_stat.stat.exists | ||
|
||
- name: Configure Topgrade | ||
become: true | ||
template: | ||
src: topgrade.j2 | ||
dest: "{{ home }}/.profile" | ||
mode: "0644" | ||
|
||
- name: Reload shell | ||
become: true | ||
shell: | | ||
echo "Reloading shell..." | ||
if [[ -n "$SHELL" ]]; then | ||
eval "$(echo $SHELL)" | ||
fi | ||
if [[ -n "$HOME" ]]; then | ||
cd ~ | ||
fi | ||
if [[ -f ~/.profile ]]; then | ||
source ~/.profile | ||
else | ||
echo "Warning: .profile file not found." | ||
fi | ||
args: | ||
executable: /bin/bash | ||
creates: "{{ home }}/.profile" |
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,5 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
export PATH="/usr/local/bin:$PATH" | ||
curl -fsSL https://github.com/topgrade-rs/topgrade/releases/download/v{{ topgrade_version }}/topgrade | sudo tee /usr/local/bin/topgrade | ||
sudo chmod +x /usr/local/bin/topgrade |
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