Podman Build Pulls

Today I learned about the pull flags in the podman build command. --pull=false: will pull the image only if it does not exist in the local repo. --pull=true: will pull the image if it doesn’t exist or if the remote has a newer version (default). --pull-always: will always pull the image. --pull-never: will never pull the image. More...

February 16, 2022 · 1 min · Iduoad

Some Podman Flags

Today I learned some useful podman flags like: --replace: to replace a container if it already exists. --ignore: to ignore errors and continue the work (very useful for bulk deletions). --tz: to set the TZ for the container. More...

February 16, 2022 · 1 min · Iduoad

set -a in Unix shells

Today I learned how to export many variable at once in Unix shells (tested in Zsh and Bash). set -a # enable the option var1="value1" var2="value2" var3="value3" var4="value4" set +a # disable the option More here...

December 14, 2021 · 1 min · Iduoad

aws Profiles

Today I learned about aws named profiles. They are defined as follows: [user1] aws_access_key_id=AKIAI44QH8DHBEXAMPLE aws_secret_access_key=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY and used as follows aws ec2 describe-instances --profile user1 More here...

December 13, 2021 · 1 min · Iduoad

Gitlab optional needs

Today I learned about optional needs which a cool feature introduced to gitlab ci, months ago. If you have a job that needs another job, and the latter can be missing due to if or only directives, you can mention it as an optional dependency. This useful in a lot of usecases. I needed it for a job that depends on two others one of them is should be optional....

June 18, 2021 · 1 min · Iduoad

Ansible error handling

Today I learned how to handle errors in ansible using block/rescue blocks. block can be used to group a set of related tasks. tasks: - name: Handle the error block: - name: Print a message ansible.builtin.debug: msg: 'I execute normally' - name: Force a failure ansible.builtin.command: /bin/false - name: Never print this ansible.builtin.debug: msg: 'I never execute, due to the above task failing, :-(' rescue: - name: Print when errors ansible....

April 22, 2021 · 1 min · Iduoad

Ansible Parted Module

Today I learned how to create and manipulate partitions with ansible using the parted module. One useful tip, that is not listed in documentation, is using the device information in order to create partitions appropriately. For example to create a partition that start where the last partion begins ans space all the space left. - name: Create partition if it does not exist community.general.parted: device: /dev/vdb number: "{{ device_info.partitions | length }}" flags: [ lvm ] part_end: "100%" part_start: "{{ device_info....

April 22, 2021 · 1 min · Iduoad