Test Repo für Ansible Semaphore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
923 B

---
- name: Setup Bash Aliases
hosts: all
become: true
tasks:
- name: Create bash_aliases file
ansible.builtin.copy:
dest: /etc/profile.d/99-custom-settings.sh
mode: '0755'
owner: root
group: root
content: |
# user alias settings
alias system-update='sudo apt update && sudo apt dist-upgrade -y'
alias ll='ls -la'
alias dcr='docker compose up -d --force-recreate'
alias dcu='docker compose build --pull; docker compose pull --ignore-buildable; docker compose up -d --force-recreate'
alias dcl='docker compose logs -f'
- name: Source the bash_aliases file
ansible.builtin.command: /bin/bash -c "source /etc/profile.d/99-custom-settings.sh"
args:
warn: false
register: source_aliases
changed_when: "source_aliases.stdout != ''"
failed_when: "source_aliases.rc != 0"