diff --git a/tasks/install.yml b/tasks/install.yml index 2fa67db..ab7d25b 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,13 +1,7 @@ --- -- name: Ensure Puppet repository is installed +- name: Ensure Puppet repository is installed from repository apt: deb: "https://apt.puppetlabs.com/puppet{{ puppet_version }}-release-{{ ansible_distribution_release }}.deb" - when: ansible_distribution_release != "hirsute" - -- name: Ensure Puppet repository is installed - apt: - deb: "https://apt.puppetlabs.com/puppet{{ puppet_version }}-release-focal.deb" - when: ansible_distribution_release == "hirsute" - name: Ensure software for Puppet server is installed package: diff --git a/tasks/install_from_source.yml b/tasks/install_from_source.yml new file mode 100644 index 0000000..821d86e --- /dev/null +++ b/tasks/install_from_source.yml @@ -0,0 +1,30 @@ +--- +- name: Ensure required software is installed + package: + name: + - openjdk-8-jre-headless + - ca-certificates-java + - leiningen + +- name: Ensure Puppetserver repository is cloned + git: + repo: git://github.com/puppetlabs/puppetserver + dest: /usr/src/puppetserver + +- name: Ensure puppet group exists + group: + name: puppet + +- name: Ensure puppet user exists + user: + name: puppet + home: /opt/puppetlabs/server/data/puppetserver + comment: puppetserver daemon + shell: /usr/sbin/nologin + +- name: Ensure puppet server home folder exists + file: + path: /opt/puppetlabs/server/data/puppetserver + state: directory + owner: puppet + group: puppet diff --git a/tasks/main.yml b/tasks/main.yml index cbe813e..9c46074 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,11 @@ --- -- name: Ensure installation - include_tasks: install.yml +- name: Ensure installation from repository + include_tasks: install_from_repository.yml + when: ansible_distribution_release != "hirsute" and ansible_distribution_release != "jammy" + +- name: Ensure installation from source + include_tasks: install_from_source.yml + when: ansible_distribution_release == "hirsute" or ansible_distribution_release == "jammy" + - name: Ensure configuration - include_tasks: configure.yml \ No newline at end of file + include_tasks: configure.yml