added claude role
This commit is contained in:
1 parent
b1ce761291
commit
7450892a68
13 files changed
+296
-11
No files matched your search
@@ -0,0 +1,44 @@
|
||||
# roles/claude_code/tasks/main.yml
|
||||
---
|
||||
- name: Assert a supported install method
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- claude_code_install_method in ['apt', 'native']
|
||||
- claude_code_apt_channel in ['stable', 'latest']
|
||||
fail_msg: "claude_code_install_method must be apt|native and claude_code_apt_channel stable|latest"
|
||||
quiet: true
|
||||
|
||||
- name: Assert a supported OS (Ubuntu 20.04+ / Debian 10+)
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ansible_facts['os_family'] == 'Debian'
|
||||
- >-
|
||||
(ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_version'] is version('20.04', '>='))
|
||||
or (ansible_facts['distribution'] == 'Debian' and ansible_facts['distribution_version'] is version('10', '>='))
|
||||
- ansible_facts['architecture'] in ['x86_64', 'aarch64']
|
||||
fail_msg: "Claude Code needs Ubuntu 20.04+/Debian 10+ on x64 or ARM64"
|
||||
quiet: true
|
||||
|
||||
- name: Install prerequisite packages
|
||||
ansible.builtin.apt:
|
||||
name: "{{ claude_code_prereq_packages }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
become: true
|
||||
|
||||
- name: Install via apt repository
|
||||
ansible.builtin.include_tasks: apt.yml
|
||||
when: claude_code_install_method == 'apt'
|
||||
|
||||
- name: Install via native installer
|
||||
ansible.builtin.include_tasks: native.yml
|
||||
when: claude_code_install_method == 'native'
|
||||
|
||||
- name: Write Claude Code settings
|
||||
ansible.builtin.include_tasks: settings.yml
|
||||
when: claude_code_settings | length > 0
|
||||
|
||||
- name: Verify installation
|
||||
ansible.builtin.include_tasks: verify.yml
|
||||
when: claude_code_verify | bool
|
||||
Reference in new issue
Block a user