|
28 | 28 | - "{{ terrarium_state_dir }}/restore" |
29 | 29 | - /usr/local/lib/terrarium |
30 | 30 |
|
31 | | -- name: Assert Terrarium compiled binaries are staged in the repo checkout |
| 31 | +- name: Assert Terrarium compiled binaries are staged in the install bundle |
32 | 32 | ansible.builtin.stat: |
33 | 33 | path: "{{ terrarium_repo_dir }}/dist/terrariumctl" |
34 | 34 | register: terrarium_compiled_cli |
|
75 | 75 | and terrarium_trm_alias.stat.lnk_source == "/usr/local/bin/terrariumctl" |
76 | 76 | ) |
77 | 77 |
|
| 78 | +- name: Create shell completion directories |
| 79 | + ansible.builtin.file: |
| 80 | + path: "{{ item }}" |
| 81 | + state: directory |
| 82 | + mode: "0755" |
| 83 | + loop: |
| 84 | + - /usr/share/bash-completion/completions |
| 85 | + - /usr/local/share/zsh/site-functions |
| 86 | + - /usr/share/fish/vendor_completions.d |
| 87 | + |
| 88 | +- name: Generate terrariumctl bash completion |
| 89 | + ansible.builtin.command: /usr/local/bin/terrariumctl completion bash |
| 90 | + register: terrariumctl_completion_bash |
| 91 | + changed_when: false |
| 92 | + |
| 93 | +- name: Generate terrariumctl zsh completion |
| 94 | + ansible.builtin.command: /usr/local/bin/terrariumctl completion zsh |
| 95 | + register: terrariumctl_completion_zsh |
| 96 | + changed_when: false |
| 97 | + |
| 98 | +- name: Generate terrariumctl fish completion |
| 99 | + ansible.builtin.command: /usr/local/bin/terrariumctl completion fish |
| 100 | + register: terrariumctl_completion_fish |
| 101 | + changed_when: false |
| 102 | + |
| 103 | +- name: Install terrariumctl bash completion |
| 104 | + ansible.builtin.copy: |
| 105 | + content: "{{ terrariumctl_completion_bash.stdout }}\n" |
| 106 | + dest: /usr/share/bash-completion/completions/terrariumctl |
| 107 | + mode: "0644" |
| 108 | + |
| 109 | +- name: Install terrariumctl zsh completion |
| 110 | + ansible.builtin.copy: |
| 111 | + content: "{{ terrariumctl_completion_zsh.stdout }}\n" |
| 112 | + dest: /usr/local/share/zsh/site-functions/_terrariumctl |
| 113 | + mode: "0644" |
| 114 | + |
| 115 | +- name: Install terrariumctl fish completion |
| 116 | + ansible.builtin.copy: |
| 117 | + content: "{{ terrariumctl_completion_fish.stdout }}\n" |
| 118 | + dest: /usr/share/fish/vendor_completions.d/terrariumctl.fish |
| 119 | + mode: "0644" |
| 120 | + |
| 121 | +- name: Install trm bash completion alias |
| 122 | + ansible.builtin.file: |
| 123 | + src: /usr/share/bash-completion/completions/terrariumctl |
| 124 | + dest: /usr/share/bash-completion/completions/trm |
| 125 | + state: link |
| 126 | + force: true |
| 127 | + when: >- |
| 128 | + not terrarium_trm_alias.stat.exists |
| 129 | + or ( |
| 130 | + terrarium_trm_alias.stat.islnk | default(false) |
| 131 | + and terrarium_trm_alias.stat.lnk_source == "/usr/local/bin/terrariumctl" |
| 132 | + ) |
| 133 | +
|
| 134 | +- name: Install trm zsh completion alias |
| 135 | + ansible.builtin.file: |
| 136 | + src: /usr/local/share/zsh/site-functions/_terrariumctl |
| 137 | + dest: /usr/local/share/zsh/site-functions/_trm |
| 138 | + state: link |
| 139 | + force: true |
| 140 | + when: >- |
| 141 | + not terrarium_trm_alias.stat.exists |
| 142 | + or ( |
| 143 | + terrarium_trm_alias.stat.islnk | default(false) |
| 144 | + and terrarium_trm_alias.stat.lnk_source == "/usr/local/bin/terrariumctl" |
| 145 | + ) |
| 146 | +
|
| 147 | +- name: Install trm fish completion alias |
| 148 | + ansible.builtin.file: |
| 149 | + src: /usr/share/fish/vendor_completions.d/terrariumctl.fish |
| 150 | + dest: /usr/share/fish/vendor_completions.d/trm.fish |
| 151 | + state: link |
| 152 | + force: true |
| 153 | + when: >- |
| 154 | + not terrarium_trm_alias.stat.exists |
| 155 | + or ( |
| 156 | + terrarium_trm_alias.stat.islnk | default(false) |
| 157 | + and terrarium_trm_alias.stat.lnk_source == "/usr/local/bin/terrariumctl" |
| 158 | + ) |
| 159 | +
|
78 | 160 | - name: Ensure root has a local password for Cockpit |
79 | 161 | ansible.builtin.user: |
80 | 162 | name: root |
|
0 commit comments