3.2.6.2. デプロイメント設定
以下は、サービス hello-world にマップするイメージ docker.io/ansibleplaybookbundle/hello-world のデプロイメント設定を作成するサンプルの Ansible タスクです。
プロビジョニング
- name: create deployment config
openshift_v1_deployment_config:
name: hello-world
namespace: '{{ namespace }}'
labels:
app: hello-world
service: hello-world
replicas: 1
selector:
app: hello-world
service: hello-world
spec_template_metadata_labels:
app: hello-world
service: hello-world
containers:
- env:
image: docker.io/ansibleplaybookbundle/hello-world:latest
name: hello-world
ports:
- container_port: 8080
protocol: TCP
プロビジョニング解除
- openshift_v1_deployment_config:
name: hello-world
namespace: '{{ namespace }}'
state: absent