Skip to content

LocalHappiness/ansible-role-zsh-p10k

Repository files navigation

Ansible Role for Oh-My-Zsh


demo

Installs the following:

This does not install fonts please install the font you would like to use: Meslo Nerd Font Patched

Requirements

Ubuntu:

  • 20.04
  • 18.04

Role Variables

#defaults/main
username:

Dependencies

This role install all dependencies such as (git and curl)

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: localhost
  gather_facts: false
  become: true
  roles:
    - ansible-zsh-p10k-role

I also like to create tasks for specific inventory items such as:

#Replace right-side prompt to indicate battery level for laptop
- name: Customizing .zshrc for {{ ansible.inventory_hostname }}
  become: yes
  lineinfile:
    dest: /home/{{ username }}/.zshrc
    regexp: "{{ item.regexp }}"
    line: "{{item.line}}"
    state: present
  with_items:
    - regexp: "^POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS"
      line: "POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status battery ip host)"
#Add aliases to the bottom of of .zshrc
- name: Copy aliases for ansible .zshrc
  lineinfile:
    path: /home/{{ username }}/.zshrc
    line: "{{ item.alias }}"
    create: yes
  loop:
    - {
        alias: 'alias hi="echo hello world!"',
      }

License

MIT

Author Information

This was created by Joshua Herman joshuaherman.tech.

Releases

No releases published

Packages

No packages published

Languages