Skip to content

Commit

Permalink
add ubuntu 24.04 support
Browse files Browse the repository at this point in the history
  • Loading branch information
chokoblitz committed Jan 14, 2025
1 parent 5af8919 commit 0a4472a
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 181 deletions.
62 changes: 58 additions & 4 deletions ansible/install_cenclave/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,61 @@
- "/home/{{ ansible_user }}/.config/gramine/enclave-key.pem"
- 3072

- name: Install Cosmian Enclave CLI
pip:
name : cenclave
extra_args: --upgrade
- name: Check Ubuntu version
ansible.builtin.debug:
msg: "Ubuntu version is {{ ansible_distribution_version }}"

- name: Print ansible_user
ansible.builtin.debug:
msg: "Ansible user is {{ ansible_user }}"

- name: Install pipx and Cosmian Enclave CLI for Ubuntu 24.04
block:
- name: Install pipx
ansible.builtin.apt:
name: pipx
state: latest

- name: Install Cosmian Enclave CLI using pipx
become: false
community.general.pipx:
name: cenclave
state: latest

- name: Ensure pipx is installed
become: false
ansible.builtin.command:
cmd: pipx ensurepath

- name: Verify cenclave is available
become: false
ansible.builtin.command:
cmd: cenclave --version
register: cenclave_version
ignore_errors: false

- name: Debug cenclave version
ansible.builtin.debug:
msg: "cenclave version: {{ cenclave_version.stdout }}"

when: ansible_distribution_version == "24.04"

- name: Install Cosmian Enclave CLI for Ubuntu 22.04
block:
- name: Install Cosmian Enclave CLI using pip
ansible.builtin.pip:
name: cenclave
extra_args: --upgrade

- name: Verify cenclave is available
become: false
ansible.builtin.command:
cmd: cenclave --version
register: cenclave_version
ignore_errors: false

- name: Debug cenclave version
ansible.builtin.debug:
msg: "cenclave version: {{ cenclave_version.stdout }}"

when: ansible_distribution_version == "22.04"
14 changes: 0 additions & 14 deletions ansible/install_pccs/templates/default_certbot_nginx.conf.j2

This file was deleted.

86 changes: 0 additions & 86 deletions ansible/install_pccs/templates/default_nginx.conf.j2

This file was deleted.

4 changes: 0 additions & 4 deletions ansible/install_pccs/templates/default_proxy_params.j2

This file was deleted.

26 changes: 0 additions & 26 deletions ansible/install_pccs/templates/default_vhost.conf.j2

This file was deleted.

14 changes: 0 additions & 14 deletions ansible/install_pccs/templates/letsencrypt.conf.j2

This file was deleted.

33 changes: 33 additions & 0 deletions ansible/install_pccs/templates/pccs.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"HTTPS_PORT" : 8081,
"hosts" : "127.0.0.1",
"uri": "https://api.trustedservices.intel.com/sgx/certification/v4/",
"ApiKey" : "{{ pccs_apikey }}",
"proxy" : "",
"RefreshSchedule": "0 0 1 * * *",
"UserTokenHash" : "{{ pccs_usertoken_hash }}",
"AdminTokenHash" : "{{ pccs_admintoken_hash }}",
"CachingFillMode" : "REQ",
"LogLevel" : "info",
"DB_CONFIG" : "{{ pccs_db_config }}",
"sqlite" : {
"database" : "{{ pccs_sqlite_db_name }}",
"username" : "{{ pccs_sqlite_cr_usr }}",
"password" : "{{ pccs_sqlite_usr_psswd }}",
"options" : {
"host": "{{ pccs_sqlite_options_host }}",
"dialect": "{{ pccs_sqlite_port_dialect }}",
"pool": {
"max": {{ pccs_sqlite_port_pool_max }},
"min": {{ pccs_sqlite_port_pool_min }},
"acquire": {{ pccs_sqlite_port_pool_acquire }},
"idle": {{ pccs_sqlite_port_pool_idle }}
},
"define": {
"freezeTableName": {{ pccs_sqlite_define_freezeTableName }}
},
"logging" : {{ pccs_sqlite_logging }},
"storage": "{{ pccs_sqlite_storage }}"
}
}
}
5 changes: 0 additions & 5 deletions ansible/install_sgx_deps/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
---
# tasks file for install_sgx_deps

- name: Debug ansible_facts
ansible.builtin.debug:
var: ansible_facts


- name: Add official Intel APT repository
block:
- name: Download Intel GPG public key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// *** ATTENTION : This file is in JSON format so the keys are case sensitive. Don't change them.

//PCCS server address
"pccs_url": "https://{{ __pccs }}/sgx/certification/v4/",
"pccs_url": "https://localhost:8081",

// To accept insecure HTTPS certificate, set this option to false
"use_secure_cert": true,
"use_secure_cert": false,

// You can use the Intel PCS or another PCCS to get quote verification collateral. Retrieval of PCK
// Certificates will always use the PCCS described in PCCS_URL. When COLLATERAL_SERVICE is not defined, both
Expand All @@ -30,7 +30,7 @@

// If LOCAL_PCK_URL is defined, the QCNL will try to retrieve PCK cert chain from LOCAL_PCK_URL first,
// and failover to PCCS_URL as in legacy mode.
//"local_pck_url": "http://localhost:8081/sgx/certification/v4/",
//"local_pck_url": "http://localhost:8081",

// If LOCAL_PCK_URL is not defined, the QCNL will cache PCK certificates in memory by default.
// The cached PCK certificates will expire after PCK_CACHE_EXPIRE_HOURS hours.
Expand Down
28 changes: 3 additions & 25 deletions ansible/main.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@

---
# - name: Collect and display virtualization facts
# hosts: all
# tasks:
# - name: Gather facts
# ansible.builtin.setup:

# - name: Display virtualization facts
# ansible.builtin.debug:
# var: ansible_facts['virtualization_type']

# - name: Display all virtualization-related facts
# ansible.builtin.debug:
# var: ansible_facts['virtualization_role']

# - name: Display all virtualization-related facts
# ansible.builtin.debug:
# var: ansible_facts['virtualization_vendor']

# - name: Display all virtualization-related facts
# ansible.builtin.debug:
# var: ansible_facts['virtualization_technology']


- name: Cosmian Enclave installation on Ubuntu
hosts: all
become: true

pre_tasks:
- name: Check if the machine is bare-metal
ansible.builtin.set_fact:
is_baremetal: "{{ ansible_facts['virtualization_type'] == 'baremetal' }}"
is_baremetal: "{{ ansible_facts['virtualization_type'] == 'kvm' }}"

roles:
- update_ubuntu
- install_docker
- install_sgx_deps

tasks:

- name: Include role install_pccs for bare-metal only
ansible.builtin.include_role:
name: install_pccs
Expand Down

0 comments on commit 0a4472a

Please sign in to comment.